+ Start a Discussion
pradyprady 

Unixtimestamp value for an salesforce date

Hi,

 

How can i get the unixtimestamp value of a date from salesforce?

 

I need to pass the date value as unixtimestamp to flot graph library.

 

thanks

Prady

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

By unix timestamp, do you mean milliseconds since the epoch (1/1/1970)?

 

If so, use the DateTime.getTime() method

All Answers

bob_buzzardbob_buzzard

By unix timestamp, do you mean milliseconds since the epoch (1/1/1970)?

 

If so, use the DateTime.getTime() method

This was selected as the best answer
Avery Henry 2Avery Henry 2

I don't know why bob's answer got a thumbs down.  DateTime.getTime() provides the unix number down to the millisecond.