PHP and MySQL syntax: Difference between revisions

Jump to navigation Jump to search
184 bytes removed ,  29 September 2013
Line 15: Line 15:
* php: {{kbd | key=<nowiki>echo time();</nowiki>}} //Return the number of seconds since 1970/01/01
* php: {{kbd | key=<nowiki>echo time();</nowiki>}} //Return the number of seconds since 1970/01/01
* mysql: {{kbd | key=<nowiki>SELECT UNIX_TIMESTAMP();</nowiki>}} //Return the number of seconds since 1970/01/01 ex: 2011-05-30 01:56:38 returns 1306720622
* mysql: {{kbd | key=<nowiki>SELECT UNIX_TIMESTAMP();</nowiki>}} //Return the number of seconds since 1970/01/01 ex: 2011-05-30 01:56:38 returns 1306720622
* javascript: getTime() Method ex: {{kbd | key=<nowiki>new Date().getTime();</nowiki>}} //Return the number of milliseconds since 1970/01/01 <ref>[http://w3schools.com/jsref/jsref_gettime.asp JavaScript getTime() Method] [http://stackoverflow.com/questions/221294/how-do-you-get-a-timestamp-in-javascript datetime - How do you get a timestamp in JavaScript? - Stack Overflow] {{access | date = 20110323}}</ref>
* javascript: getTime() Method ex: {{kbd | key=<nowiki>new Date().getTime();</nowiki>}} //Return the number of milliseconds since 1970/01/01 <ref>[http://w3schools.com/jsref/jsref_gettime.asp JavaScript getTime() Method]</ref>
* EXCEL: [http://stackoverflow.com/questions/1703505/excel-date-to-unix-timestamp Excel date to Unix timestamp - Stack Overflow]
* EXCEL: [http://stackoverflow.com/questions/1703505/excel-date-to-unix-timestamp Excel date to Unix timestamp - Stack Overflow]


Navigation menu