ted_chou12 Posted December 19, 2006 Share Posted December 19, 2006 I know how to choose specific date format like this: date("m/d/y h:i a"), but what if i just want the simple date format, eg. 1194059 like those? Link to comment https://forums.phpfreaks.com/topic/31250-i-just-want-the-simple-date-format/ Share on other sites More sharing options...
ted_chou12 Posted December 19, 2006 Author Share Posted December 19, 2006 by the way, i want it to milli seconds, or as accurate as possible. but like what i said above, I just want a string of numbers. Link to comment https://forums.phpfreaks.com/topic/31250-i-just-want-the-simple-date-format/#findComment-144550 Share on other sites More sharing options...
craygo Posted December 19, 2006 Share Posted December 19, 2006 Can use microtime function[code]<?php$now = strtotime("now");$micro = microtime($now);echo $micro;?>[/code]not sure if that is what you wantRay Link to comment https://forums.phpfreaks.com/topic/31250-i-just-want-the-simple-date-format/#findComment-144553 Share on other sites More sharing options...
ted_chou12 Posted December 19, 2006 Author Share Posted December 19, 2006 okay, thanks, btw, how accurate is micro time? Link to comment https://forums.phpfreaks.com/topic/31250-i-just-want-the-simple-date-format/#findComment-144554 Share on other sites More sharing options...
craygo Posted December 19, 2006 Share Posted December 19, 2006 2 decimal places so to the hundredth of a second.Ray Link to comment https://forums.phpfreaks.com/topic/31250-i-just-want-the-simple-date-format/#findComment-144555 Share on other sites More sharing options...
AV1611 Posted December 19, 2006 Share Posted December 19, 2006 <?php$d=date('dmoHis');$t=gettimeofday();$t=$t[usec];$tod=$d.$t;echo "The exact time is: ".$tod;?>This one was easy right out of the manualgives: ddmmyyyyhhmmssuuuuuuthat's pretty acurate... Link to comment https://forums.phpfreaks.com/topic/31250-i-just-want-the-simple-date-format/#findComment-144558 Share on other sites More sharing options...
ted_chou12 Posted December 19, 2006 Author Share Posted December 19, 2006 nice!! ;)thanks av1611 Link to comment https://forums.phpfreaks.com/topic/31250-i-just-want-the-simple-date-format/#findComment-144559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.