Forum OpenACS Q&A: Re: Calendar

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":


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.

8: Re: Calendar (response to 6)
Posted by Orzenil Silva Junior on

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 . it is a little outdated but still works :)

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

And the force may be with you. :)