how to convert windows date and time to unix date and time
GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
What form does the Windows date take? mmddyyyhhmmss - or something of the like; as I highly doubt it references from the epoch (Jan 1, 1970).
Here's the Wikipedia article on UNIX time. Get on them regexes.
EDIT: I just re-read your post - going from Windows D&T to Windows D&T sure sounds like a daunting task; I wish you the best of luck with it. *heheh* I assumed you meant Windows D&T to POSIX D&T.
Last edited by indienick; 03-27-2008 at 07:48 AM.
Reason: Oversight
how to convert data and time to unix date and time
hey indienick i now how to convert the current date and time to unix timestamp i am doing this with C#.net and now i want to convert the dates which are given to me in a file .like this
While I can't provide a language-specific answer (as I don't know C#), I can give you a general algorithm to follow (besides, where's the fun in it if I just give you the answer? ):
Code:
1. Initialize a counting variable.
2. Parse the string (to get the numbers in between the '/', ':' and space.
3. Convert all numbers to seconds, and add them to the counting variable.
It's a really simple algorithm...not to mention a really simple task.
how to convert windows date and time to unix date and time
Quote:
Originally Posted by indienick
While I can't provide a language-specific answer (as I don't know C#), I can give you a general algorithm to follow (besides, where's the fun in it if I just give you the answer? ):
Code:
1. Initialize a counting variable.
2. Parse the string (to get the numbers in between the '/', ':' and space.
3. Convert all numbers to seconds, and add them to the counting variable.
It's a really simple algorithm...not to mention a really simple task.
well thanks for all your help i have developed the code in C#. and its working fine now but i really appreciated your help. thanks alot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.