Hey guys,
I'm just wondering if it were at all possible to convert a formatted date back to a timestamp, (date originally formatted for user friendliness). The user is to enter a date DD/MM/YYYY (the way us Australians write it, not MM/DD/YYYY), is there any way this can be made a timestamp again, doesnt have to be precise to the second, so it can be the correct date, but at 12:00am if it has to be?
Thanks
Converting Date
Moderator: General Moderators
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
Converting Date
Last edited by iknownothing on Sun Mar 25, 2007 8:24 pm, edited 2 times in total.
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
mktime() looks like a winner, thanks.
Also, with using mktime(), I've read that blank arguments within mktime() use the current time (eg minutes/seconds).
The reason I asked the original question, is because the user enters in formatted dates From and To, to get all specific entries in between these two dates. If entry "A" was orginally entered using mktime(), but hours minutes and seconds was left blank, would a search between the From and To also include entry "A" if the search was done before the original entry time? Or would it be better practice to set hours, minutes and seconds to a "zero" value (ie. right on Midnight) when entering data, and 11:59pm on the search?
Thanks again.
Also, with using mktime(), I've read that blank arguments within mktime() use the current time (eg minutes/seconds).
The reason I asked the original question, is because the user enters in formatted dates From and To, to get all specific entries in between these two dates. If entry "A" was orginally entered using mktime(), but hours minutes and seconds was left blank, would a search between the From and To also include entry "A" if the search was done before the original entry time? Or would it be better practice to set hours, minutes and seconds to a "zero" value (ie. right on Midnight) when entering data, and 11:59pm on the search?
Thanks again.