如何在javascript中创建18位数的时间戳?

How to create 18 digit timestamp in javascript?

Trying to send http headers to Facebook registration connect plugin which requires an 18 digit timestamp like: 265816695112975178

It is supposed to be current date-time reference.

Can anyone please help me build the code in Javascript preferably to create the timestamp? If not in JS then PHP please.

Thanks

Normally a timestamp of that magnitude indicates the number of milliseconds since the unix epoch (January 1st 1970, midnight UTC). EDIT: This doesn't actually give 18 digits... it gives 13 digits for "modern" timestamps.

Getting that in Javascript is easy, as that's the natural representation inside a Date object:

var timestamp = new Date().getTime();

The current value is about 1374818815000.

If that's not the intended semantics, you'll have to give more details (or link to documentation).