Forum OpenACS Q&A: Re: Calendar

Collapse
5: Re: Calendar (response to 1)
Posted by Jade Rubick on
I'm sorry, I don't really understand what you're asking. You may need to provide some more detail. Generally, you'll get about as much time spent on the answers as you spend on the questions :)
Collapse
6: Re: Calendar (response to 5)
Posted by Rocco Siffredi on
I'm sorry too :).
I agree with you and now, I´ll try to be more clear.

Imagine this "universe":

time_intervals:

id|interval_id| start_date          | end_date
-----------------------------------------------------------
n|  n        |2004-08-25 06:00:00+02|2004-08-2506:00:00+02

n= a number.

Well, my question -> How can i get the date and the hour split in start-date ? For example, If i want to show the date only.
It´s possible with the timestamptz type.

Thank you very much.

Collapse
7: Re: Calendar (response to 5)
Posted by Rocco Siffredi on
When I told you:
It's possible with timestamptz type, i'll want to tell
Is it possible with timestamptz type ?.
Collapse
8: Re: Calendar (response to 6)
Posted by Orzenil Silva Junior on
Hi,

Supposing you're running postgresql and start_date and end_date are timestampz datatypes you could split date and time with something like this:

for date:

select start_date::DATE from time_intervals

for time:

select start_date::TIME from time_intervals

You could try a real example with acs_objects table in your oacs instalation: select creation_date::DATE from acs_objects

A good reading about dates and times in postgresql is http://techdocs.postgresql.org/techdocs/faqdatesintervals.php . it is a little outdated but still works :)

Collapse
9: Re: Calendar (response to 8)
Posted by Rocco Siffredi on
Thanks Orzenil.

And the force may be with you. :)