![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
King of Portal
|
I'm a bit confused regarding the Unix timestamps in PHP. When I use the function time() I get a Unix timestamp. However, does this returned timestamp contain in it daylight savings and timezone offsets? Or does the number solely represent a GMT timestamp? Is it the power of the date() function that takes the timezone and dst into effect? Any suggestions on this riddle? I ask because I have a timestamp that is offset from GMT which I convert into a unix timestamp using strtotime() and I need to compare it to the current date unix timestamp to see if it has expired. However I can't compare timestamps in different timezones. So will time() and strtotime() yield Unix timestamps which are in the same timezone? Wow that's confusing.
![]()
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#2 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
A timestamp is the number of seconds elapsed since midnight, January 1, 1970, GMT. At any moment, at any place in the world (or out of the world, for that matter), that number is the same.
Have you referred to the PHP manual? For instance, Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#3 | |
|
King of Portal
|
I did refer to the manual first and it was two things which confused me, perhaps due to lack of reading comprehension on my own part. Namely
Quote:
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
I noticed that during the winter windoes says my timezone is GMT-5, and in the summer it is GMT-4. so the timezone shouldn't make a difference, although whether it does or not I haven't the slightest.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| convert dates in Unix time format | ktsirig | PHP | 2 | Feb 11th, 2007 8:20 PM |
| Unix commands compatible with Windows? | titaniumdecoy | Bash / Shell Scripting | 7 | Oct 5th, 2006 7:25 AM |
| Lions' Commentary on UNIX 6th Edition, with source code | Mad_guy | Book Reviews | 0 | Sep 24th, 2006 7:06 PM |
| Best Linux or Unix Desktop? | Prm753 | Coder's Corner Lounge | 23 | Apr 8th, 2006 10:17 AM |
| Importing from DLL's on Unix | Kaja Fumei | Existing Project Development | 5 | Jan 9th, 2006 6:35 PM |