Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1464 How do I convert the number of milliseconds since January 1, 1970, 00:00:00 into its corresponding date (dd/mm/yy format)?

You are here: irt.org | FAQ | JavaScript | Date | Q1464 [ previous next ]

Try:

<script language="JavaScript"><!--
var aDate = 925241310748; // miliseconds Since 1970;

theDate = new Date(aDate);
dd = theDate.getDate();
mm = theDate.getMonth()+1; // 0 based
yy = theDate.getYear();
if (yy < 1000) yy +=1900; // Y2K fix

alert (dd+'/'+mm+'/'+yy);
//--></script>

Feedback on 'Q1464 How do I convert the number of milliseconds since January 1, 1970, 00:00:00 into its corresponding date (dd/mm/yy format)?'

©2018 Martin Webb