• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

time to string problem

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)
i want to get the current time in one variable like t=11.10.25.33

var t = start.getHours+start.getMinutes+start.getseconds()+start.getmilliseconds()

above wont work.
i want to get current time in one variable and paas that as the string.
so how can i get time in one variable and as a string?

2)
i want to know how the parse method is used?

i am trying this but getting error
var start = new parse();

or even var start = new Date()
doucment.write(start.parse())
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i want to get the current time in one variable like t=11.10.25.33

var t = start.getHours+start.getMinutes+start.getseconds()+start.getmilliseconds()



For getting the required string you can use

var t = start.getHours()+"."+start.getMinutes()+"."+start.getSeconds();
The above will work and give you a string.
Unfortunately i dont think milliseconds work.
 
swapnil paranjape
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah miliseconds doesnt work that way ...and i want miliseconds also so what should i do i was trying to use object to get everything in it.
what do u suggest?
thanx
 
reply
    Bookmark Topic Watch Topic
  • New Topic