How do you get a timestamp in JavaScript? How can I get a timestamp in JavaScript? Something similar to Unix's timestamp, that is, a single number that represents the current time and date. Either as a number or a string. Answer: Short & Snazzy: + new Date() A unary operator like plus triggers the valueOf method in the Date object and it returns the time-stamp (without any alteration). Details: On almost all current browsers you can use Date.now() to get the UTC timestamp in milliseconds; a notable exception to this is IE8
undefined
Should I use field 'datetime' or 'timestamp'? Would you suggest using a datetime or a timestamp field, and why (using MySQL)? I'm working with PHP on the server side. solution: Timestamps in MySQL generally used to track change to records, and are often updated each time the record is changed. If you want to store a specific value you should use a datetime field. If you meant that you want to decide linking using a UNIX timestamp or a native MySQL datetime field,