SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    any method in javascript to convert seconds to date

    Hi All ,

    Do we have any method in javascript to convert seconds(1205209821) to the date and time format like DD.MM.YYYY HH.MM.SS . the seconds gives the time elapsed since reference (Jan 1st 1970.)

    OR

    Is there any other alternate for this ..


    Thanks in advance..

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hi Ian

    i cant see ur response since that link is blocked in my office..

    anyways thanks for ur response.

    but i got the solution in the meanwhile and in the following way..

    var curdate = new Date(null);
    curdate.setTime(1205209821*1000);
    alert(curdate.toLocaleString());


    This is what i want and i got it..

    Thanks
    Durga prasad.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •