Hi all
i am trying out to type out the local time here but i canot just use time() as it onli gives a timestamp. I am totally lost as how to convert the time to the local time here. And i want to display it as datetime format. The timezone i need is GMT +8
Thanks
converting time
Moderator: General Moderators
-
SidewinderX
- Forum Contributor
- Posts: 407
- Joined: Fri Jul 16, 2004 9:04 pm
- Location: NY
There must be a million ways to do this:
time() is in seconds, so to add 8 hours - convert 8 hours to seconds a la
If you want it in datetime format you can use the date() function [even has format characters for timezones (may be of a help) ]
Never used it before, but there is even a localtime() function
time() is in seconds, so to add 8 hours - convert 8 hours to seconds a la
Code: Select all
$time = time() + (60 * 60 * ;Never used it before, but there is even a localtime() function
date difference
thks, i got another problem here.
I need to make calculate the date difference between 2 dates and the format of those 2 dates are YYYY-MM-DD, on a side note how so u calculate if there is a leap year and thus how do u know if 29 feb is a valid date.
Regards
I need to make calculate the date difference between 2 dates and the format of those 2 dates are YYYY-MM-DD, on a side note how so u calculate if there is a leap year and thus how do u know if 29 feb is a valid date.
Regards
Try refer to examples here :
http://www.developertutorials.com/tutor ... page1.html
http://www.codewalkers.com/c/a/Miscella ... leap-year/
http://www.developertutorials.com/tutor ... page1.html
http://www.codewalkers.com/c/a/Miscella ... leap-year/