• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date conversion  RSS feed

 
William Wild
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have been dredging the internet for an answer to this question on and off for the past few weeks, but have yet too find a solution.
All I require is a way of turning a string in the form DD:MM:YY[YY] [hh:mm:ss] to a long number time after epoch. Where anything in the [] is an option within the string.
Any help would be greatfully recieved, possibly acompanied with rivers of tears and hugs all round. This is driving me up the wall.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems to do the job -- thanks in part to the fact that SimpleDateFormat uses lenient parsing by default (see setLenient). To get milliseconds just call getTime() on the Date returned by the DateFormat object.
- Peter
[ April 25, 2003: Message edited by: Peter den Haan ]
 
William Wild
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,
Thanks for that. It's just whatI'm looking for.
Cheers
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My pleasure. I expected at least a hug tho
- Peter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!