![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | date time conversion so im working with this system that spits out 1195047591 as a date/time and im not really sure how to convert that in to GMT. that time was taken at about 8:39am today (11/14) Thanks Justin |
My System Specs![]() |
| | #2 (permalink) |
| | Re: date time conversion "Justin Rich" <jrich523@xxxxxx> wrote in message news:unmkkqsJIHA.1168@xxxxxx Quote: > so im working with this system that spits out 1195047591 as a date/time > and im not really sure how to convert that in to GMT. that time was taken > at about 8:39am today (11/14) ?dateadd("s",1195047591,#1/1/1970#) 11/14/2007 1:39:51 PM since you are 5 hours off from UTC ?dateadd("h",-5,dateadd("s",1195047591,#1/1/1970#)) 11/14/2007 8:39:51 AM |
My System Specs![]() |
| | #3 (permalink) |
| | Re: date time conversion "Bob Butler" <noway@xxxxxx> wrote in message news:e3Af2tsJIHA.5624@xxxxxx Quote: > "Justin Rich" <jrich523@xxxxxx> wrote in message > news:unmkkqsJIHA.1168@xxxxxx Quote: >> so im working with this system that spits out 1195047591 as a date/time >> and im not really sure how to convert that in to GMT. that time was taken >> at about 8:39am today (11/14) > looks like it's the the number of seconds since 1/1/1970 in UTC > > ?dateadd("s",1195047591,#1/1/1970#) > 11/14/2007 1:39:51 PM > > since you are 5 hours off from UTC > ?dateadd("h",-5,dateadd("s",1195047591,#1/1/1970#)) > 11/14/2007 8:39:51 AM dates isn't going to work in powershell. Hopefully you get the idea anyway! |
My System Specs![]() |
| | #4 (permalink) |
| | Re: date time conversion Either way... that number is way small for UTC UTC from today is 128395249478332360 his number is 1195047591 Not Even close. Maybe it would be a good idea to figure out how Justin got that number? Spits out is kinda vague Brandon Shell --------------- Blog: http://www.bsonposh.com/ PSH Scripts Project: www.codeplex.com/psobject BB> "Bob Butler" <noway@xxxxxx> wrote in message BB> news:e3Af2tsJIHA.5624@xxxxxx BB> Quote: Quote: >> "Justin Rich" <jrich523@xxxxxx> wrote in message >> news:unmkkqsJIHA.1168@xxxxxx >> Quote: >>> so im working with this system that spits out 1195047591 as a >>> date/time and im not really sure how to convert that in to GMT. that >>> time was taken at about 8:39am today (11/14) >>> >> >> ?dateadd("s",1195047591,#1/1/1970#) >> 11/14/2007 1:39:51 PM >> since you are 5 hours off from UTC >> ?dateadd("h",-5,dateadd("s",1195047591,#1/1/1970#)) 11/14/2007 >> 8:39:51 AM >> BB> manipulating dates isn't going to work in powershell. Hopefully you BB> get the idea anyway! BB> |
My System Specs![]() |
| | #5 (permalink) |
| | Re: date time conversion "Brandon Shell [MVP]" <a_bshell.mask@xxxxxx> wrote in message news:29d4f64625048c9f4b9fd59ba3b@xxxxxx Quote: > Either way... that number is way small for UTC > > UTC from today is 128395249478332360 > his number is 1195047591 > > Not Even close. 1195047591 seconds is just under 38 years Jan 1, 1970 + 1195047591 seconds is Nov 14, 2007 at 13:39:51 a 5-hour offset from UTC would put that back to 8:39:51AM |
My System Specs![]() |
| | #6 (permalink) |
| | Re: date time conversion "Bob Butler" <noway@xxxxxx> wrote in message news:e3Af2tsJIHA.5624@xxxxxx Quote: > "Justin Rich" <jrich523@xxxxxx> wrote in message > news:unmkkqsJIHA.1168@xxxxxx Quote: >> so im working with this system that spits out 1195047591 as a date/time >> and im not really sure how to convert that in to GMT. that time was taken >> at about 8:39am today (11/14) > looks like it's the the number of seconds since 1/1/1970 in UTC > > ?dateadd("s",1195047591,#1/1/1970#) > 11/14/2007 1:39:51 PM > > since you are 5 hours off from UTC > ?dateadd("h",-5,dateadd("s",1195047591,#1/1/1970#)) > 11/14/2007 8:39:51 AM > try something along these lines: $d=new-object System.DateTime(1970,1,1) $d=$d.AddSeconds(1195047591) $d=$d.ToLocalTime() there's probably a better way; I find it very difficult to think in "powershell" and have to translate from other languages |
My System Specs![]() |
| | #7 (permalink) |
| | Re: date time conversion "Bob Butler" <noway@xxxxxx> wrote in message news:e3Af2tsJIHA.5624@xxxxxx Quote: > "Justin Rich" <jrich523@xxxxxx> wrote in message > news:unmkkqsJIHA.1168@xxxxxx Quote: >> so im working with this system that spits out 1195047591 as a date/time >> and im not really sure how to convert that in to GMT. that time was taken >> at about 8:39am today (11/14) > looks like it's the the number of seconds since 1/1/1970 in UTC > > ?dateadd("s",1195047591,#1/1/1970#) > 11/14/2007 1:39:51 PM > > since you are 5 hours off from UTC > ?dateadd("h",-5,dateadd("s",1195047591,#1/1/1970#)) > 11/14/2007 8:39:51 AM > try something along these lines: $d=new-object System.DateTime(1970,1,1) $d=$d.AddSeconds(1195047591) $d=$d.ToLocalTime() there's probably a better way; I find it very difficult to think in "powershell" and have to translate from other languages |
My System Specs![]() |
| | #8 (permalink) |
| | Re: date time conversion Bob's right, the date comes out correct. i left if vague because its from an application log for Acronis True Image and there is no info on the log file format so all i have is this number and my knowledge of when the task was run. Thanks for the help guys. Justin "Brandon Shell [MVP]" <a_bshell.mask@xxxxxx> wrote in message news:29d4f64625048c9f4b9fd59ba3b@xxxxxx Quote: > Either way... that number is way small for UTC > > UTC from today is 128395249478332360 > his number is 1195047591 > > Not Even close. > > Maybe it would be a good idea to figure out how Justin got that number? > Spits out is kinda vague > > Brandon Shell > --------------- > Blog: http://www.bsonposh.com/ > PSH Scripts Project: www.codeplex.com/psobject > > BB> "Bob Butler" <noway@xxxxxx> wrote in message > BB> news:e3Af2tsJIHA.5624@xxxxxx > BB> Quote: Quote: >>> "Justin Rich" <jrich523@xxxxxx> wrote in message >>> news:unmkkqsJIHA.1168@xxxxxx >>> >>>> so im working with this system that spits out 1195047591 as a >>>> date/time and im not really sure how to convert that in to GMT. that >>>> time was taken at about 8:39am today (11/14) >>>> >>> looks like it's the the number of seconds since 1/1/1970 in UTC >>> >>> ?dateadd("s",1195047591,#1/1/1970#) >>> 11/14/2007 1:39:51 PM >>> since you are 5 hours off from UTC >>> ?dateadd("h",-5,dateadd("s",1195047591,#1/1/1970#)) 11/14/2007 >>> 8:39:51 AM >>> > BB> manipulating dates isn't going to work in powershell. Hopefully you > BB> get the idea anyway! > BB> > |
My System Specs![]() |
| | #9 (permalink) |
| | Re: date time conversion UTC is 100-nanoseconds from January 1, 1601 http://msdn2.microsoft.com/en-us/library/ms724284.aspx Seconds from Jan 1, 1970 is a Unix/Linux called Epoch Time. http://en.wikipedia.org/wiki/Unix_time Which is exactly why I asked where he got the time format. Brandon Shell --------------- Blog: http://www.bsonposh.com/ PSH Scripts Project: www.codeplex.com/psobject BB> "Brandon Shell [MVP]" <a_bshell.mask@xxxxxx> wrote in message BB> news:29d4f64625048c9f4b9fd59ba3b@xxxxxx BB> Quote: Quote: >> Either way... that number is way small for UTC >> >> UTC from today is 128395249478332360 >> his number is 1195047591 >> Not Even close. >> BB> 1195047591 seconds is just under 38 years BB> Jan 1, 1970 + 1195047591 seconds is Nov 14, 2007 at 13:39:51 BB> BB> a 5-hour offset from UTC would put that back to 8:39:51AM BB> |
My System Specs![]() |
| | #10 (permalink) |
| | Re: date time conversion "Brandon Shell [MVP]" <a_bshell.mask@xxxxxx> wrote in message news:29d4f64625208c9f4d83fa76492@xxxxxx Quote: > UTC is 100-nanoseconds from January 1, 1601 > http://msdn2.microsoft.com/en-us/library/ms724284.aspx interpreted as UTC time. To get local time you have to account for the offset to the local time zone. http://en.wikipedia.org/wiki/Coordinated_Universal_Time It may be that the values aren't truly accurate UTC times and are off by whatever leap seconds have been ignored and might be better called GMT time instead of UTC time. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Date time calculations | PowerShell | |||
| Time and Date Settings | Vista mail | |||
| Date and Time | Vista General | |||
| Parsing IIS web server logs + time-series conversion | PowerShell | |||
| Date and Time | Tutorials | |||