os.date

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
cgruber
Posts: 36
Joined: Tue Sep 06, 2005 6:38 am

os.date

Post by cgruber »

When I run os.date("%c") on my psp the time is wrong.
It should give me 14:44 but I get 22:14.

What am I doing wrong? the lua player on windows displays the correct time.
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

if i had to make a guess, i'd say it was timezone related..
Chaosmachine Studios: High Quality Homebrew.
MasterQ
Posts: 7
Joined: Sat Oct 01, 2005 10:05 am

Post by MasterQ »

I am having the exact same problem. I think the Lua Player is making an error with timezones. I am on EST (-5) and it randomly gives me either EST, which is what I want, or GMT(0), which is the time before the timezone is taken into account.
2Xtremes2004
Posts: 53
Joined: Wed Aug 31, 2005 1:43 am

Post by 2Xtremes2004 »

Why does 12:00 = 0:00 and will this be fixed in a future version of Lua?
I want my money back!?
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

2Xtremes2004 wrote:Why does 12:00 = 0:00 and will this be fixed in a future version of Lua?
The timezone bug should be fixed in version 0.11.

Do you mean 12:00 pm = 0:00? This is right, see the documentation at http://www.lua.org/manual/5.0/manual.html#5.7 and http://unixhelp.ed.ac.uk/CGI/man-cgi?strftime for a manual, which format strings you can use to use am/pm syntax.
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

Ver 0.11 fixed it alright but I think Daylight Saving Time is not applied. My timezone here is GMT-8. PSP itself shows correct time with Daylight Saving.
Geo Massar
Retired Engineer
2Xtremes2004
Posts: 53
Joined: Wed Aug 31, 2005 1:43 am

Post by 2Xtremes2004 »

Yes, 12:00 pm = 0:00 is what I ment, but I now see how it is set up after looking at the two links you provided. Thx

I was able to get the time and date feature formatted the way I like. :)
However I did have one question about it: %p shows the Prefix "AM" and "PM", and %P is supose to show the prefix "am" and "pm", but %P dont show anything.
Is there something else I can use to get it to show "am" and "pm"?
I want my money back!?
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

2Xtremes2004 wrote:However I did have one question about it: %p shows the Prefix "AM" and "PM", and %P is supose to show the prefix "am" and "pm", but %P dont show anything.
Is there something else I can use to get it to show "am" and "pm"?
I don't know, perhaps this is a bug in the libc from PSPSDK, but as a workaround you could use string.tolower or you can built your own string, like in http://www.luaplayer.org/gallery/clock.lua.txt with "*t" and using the returned table.
mystic_memories
Posts: 12
Joined: Sun Mar 12, 2006 8:27 am

Post by mystic_memories »

Has this bug been re-introduce recently? When I do a os.date("*t"), the hour doesn't seem to take my timezone into consideration. i.e. I get the GMT time rather than the time of my local timezone. I also tried os.date("!*t") as well, they both return the same result.
matriculated
Posts: 31
Joined: Sat Mar 04, 2006 1:35 am

Post by matriculated »

Same thing over here. The clock program is 12 hours ahead
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

There is still a problem with the timezone, see http://wiki.ps2dev.org/psp:lua_player:todos . Would be nice, if always the time would be used, which you can see in the normal PSP menu, but I don't know how to do it.
Post Reply