MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

How to generate DateTime value using Jquery

0
Started on: 28 December 12
Participants: 1

Hi ,

I want to generate datetime vaule like dd/mm/yy H:i:s format

I tried

 var now = new Date(); now.getTime() //return some numbers like 1356662676729

i want in flexible format

Hi ,

I want to generate datetime vaule like dd/mm/yy H:i:s format

I tried

var now = new Date(); now.getTime() //return some numbers like 1356662676729 i want in flexible format

This challenge is listed under Development & Implementations Community

Related Posts:

Initiator

Aravinthan
Aravinthan
  Follow

I am passinate about IT & PHP , Let's do it

More posts by: Aravinthan Asokan

1 Suggestion

  1. 28 December 12
    0

    Hi InnoThink,

    I have a javascript code which I alway use when i have to create date, hope this will help -

    <script type="text/javascript"> var now = new Date(); var yy = now.getFullYear(); var mo = (((now.getMonth()+1)+"").length == 1) ? "0"+now.getMonth() : (now.getMonth()+1)+""; var dd = ((now.getDate()+"").length == 1) ? "0"+now.getDate() : now.getDate()+""; var hh = ((now.getHours()+"").length == 1) ? "0"+now.getHours() : now.getHours()+""; var mi = ((now.getMinutes()+"").length == 1) ? "0"+now.getMinutes() : now.getMinutes()+""; var ss = ((now.getSeconds()+"").length == 1) ? "0"+now.getSeconds() : now.getSeconds()+""; var dt = dd+"/"+mo+"/"+yy+" "+hh+":"+mi+":"+ss; alert(dt); </script>

Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top