Forum OpenACS Development: How to use lc_fmt_time?

Hi!

I'm getting different time zones with lang::user::timezone and land:system:timezone. And it works

But, if I want to change how to show a time/date using a time zone, lc_fmt_time doesn't works.

For example:

set var_debug_1 [lc_time_fmt "2008-02-25 10:00:00" "%x %X %Z" "US/Mountain"]
set var_debug_2 [lc_time_fmt "2008-02-25 10:00:00" "%x %X %Z" "America/Bogota"]

The results are the same and second var must be different (two hours)

Anybody knows if I'm wrong or if lc_time_fmt is buggy?

Thanks
Cesareo

Collapse
Posted by Dave Bauer on
I don't see where lc_time_fmt accepts a timezone argument.

https://openacs.org/api-doc/proc-view?proc=lc%5ftime%5ffmt

It is for formatting a timestamp in a certain language or style. It does not manipulate the value of the timestamp at all.

The optional parameter is for the LOCALE to format the date. So you could format the date in en_US or en_GB which would most likely switch the month/day in the date format. It would not convert the time to GMT.

Collapse
Posted by Cesareo Garci­a Rodicio on
Thanks!

I was totally lost 😊

Cesáreo