9 Replies Latest reply on Sep 6, 2016 1:49 PM by powershell_guru

    EEPC Timestamp Format?

    rmmiles

      Does anyone know what format is being used for timestamps in EEPC? Also, I just want to confirm that the "Token Timestamp" contains the date / time that the user's password was last updated in the ePO database?

       

      Example from the "Save Machine Info..." ("Allow users to create endpoint info file" EEPC setting) option under "Encryption System Status" GUI on a client.

       

      UUID:                    XXXXXXXXXXXXXXXXXXXXXXXXXX

      Name:                    xxxxxxxx

      UserNameTime:            1362690002277

      Certificate Timestamp:   0

      Token UUID:              XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX

      Token Timestamp:         13011304329860

      Logon Data Timestamp:    13014419283577

      Self-Recovery State:     Uninitialized

      Self-Recovery Timestamp: 13008886187653

      SSO Timestamp:           13011376453400

       

      Thanks!

        • 1. Re: EEPC Timestamp Format?

          I think this vbscript will work for you.

           

           

          >

          interval = 13011376453400

          minutes = interval /1000/60

          seconds = 60 *  ((interval/1000) - Int((interval/1000)))

          timestamp =  DateAdd("n",minutes, #1 jan 1600#)

          timestamp = DateAdd("s",seconds,timestamp)

           

          WScript.Echo timestamp

          <

          1 of 1 people found this helpful
          • 2. Re: EEPC Timestamp Format?
            rmmiles

            Thanks for the script, I just tried it against a password token I set today:

             

            • Actual time when I set password token: "6/21/2013 09:55:17", timestamp from ePO: "13016296515886"
            • Result from VB script: "6/20/2012 1:55:53 PM"

             

            So it seems to be off by a bit, any thoughts?

             

            Thanks again...

            • 3. Re: EEPC Timestamp Format?

              Humm - what time zone are you in? The timestamp is in UTC, so that could explain a few hours difference, but you are a ong way off?

              • 4. Re: EEPC Timestamp Format?
                rmmiles

                I am in (UTC-05:00) Eastern Time. I checked the server and it is in the correct time zone, with the correct time / date too.

                • 5. Re: EEPC Timestamp Format?

                  It's never easy - try this one instead :-)

                   

                  >>

                  interval = 13016296515886

                  minutes = Int((interval/1000)/60)

                   

                   

                  seconds = Int ((interval/1000) - (minutes*60))

                  timestamp =  DateAdd("n",minutes, #1 jan 1601#)

                  timestamp = DateAdd("s",seconds,timestamp)

                   

                   

                  TZ = GetTimeZoneOffset

                   

                  WScript.Echo "EPO Timestamp : " & interval & " = "

                  WScript.Echo timestamp & " UTC"

                  WScript.Echo DateAdd("n",tz(0),timestamp) & " " & tz(1)

                   

                   

                  Function GetTimeZoneOffset()

                      Const sComputer = "."

                   

                   

                      Dim oWmiService : Set oWmiService = _

                          GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _

                                    & sComputer & "\root\cimv2")

                   

                   

                      Dim cTimeZone : Set cTimeZone = _

                          oWmiService.ExecQuery("Select * from Win32_TimeZone")

                   

                   

                      Dim oTimeZone

                      For Each oTimeZone in cTimeZone

                          GetTimeZoneOffset = Array( oTimeZone.Bias ,oTimeZone.caption)

                          Exit For

                      Next

                  End Function

                  <<

                   

                  Message was edited by: SafeBoot on 6/24/13 4:58:58 PM EDT
                  • 6. Re: EEPC Timestamp Format?
                    Timmah

                    Hey folks,

                     

                    Just to add a little caveat to the mix: userNameTime is in a different format to the rest (it's in a Java timestamp format), so I'd keep that timestamp separate from your scripts!


                    Cheers,

                     

                    Tim

                    • 7. Re: EEPC Timestamp Format?

                      thanks Tim!

                      • 8. Re: Re: EEPC Timestamp Format?
                        rmmiles

                        I recently had to revisit this using Java with Joda-Time. Here's the code to convert the "UserNameTime" and "Token Timestamp":

                         

                        // Set outPattern for dateTime

                        outPattern = "MM-dd-yyy hh:mm:ss a";


                        // UserNameTime Example

                        String inputDateTime = "1433529027588";

                        long inputDateTimeL = Long.parseLong(inputDateTime);

                        DateTime dt = new DateTime(inputDateTimeL); // convert to date type

                        DateTimeFormatter fmtPrint = DateTimeFormat.forPattern(outPattern).withZone(DateTimeZone.forID("America/New_ York")); // configure pattern for output

                        results = fmtPrint.print(dt); // print date using proper format

                         

                        // Token Timestamp Example

                        String inputDateTime = "13084297776326";
                        long inputDateTimeL = Long.parseLong(inputDateTime);

                        int minutes = (int) (inputDateTimeL / 1000 / 60);

                        int seconds = 60 * ( ((int) (inputDateTimeL / 1000)) - (int) (inputDateTimeL / 1000) );

                        DateTimeFormatter fmtParse = DateTimeFormat.forPattern("yyyyMMdd").withZone(DateTimeZone.UTC); // configure pattern for input, also set as UTC time zone

                        DateTime dt = fmtParse.parseDateTime("16010101");

                        dt = dt.plusMinutes(minutes);

                        dt = dt.plusSeconds(seconds);

                        DateTimeFormatter fmtPrint = DateTimeFormat.forPattern(outPattern).withZone(DateTimeZone.forID("America/New_ York")); // configure pattern for output

                        results = fmtPrint.print(dt); // print date using proper format

                        • 9. Re: EEPC Timestamp Format?
                          powershell_guru

                          Thought I would bring us into the current century.

                           

                          Ala Powershell....

                           

                          Also, can anyone speak to the actual threshold of these intervals?  If token timestamp is "x" out of date, then token is invalid?

                           

                          Function Translate-DETimestamp

                          {

                              [CmdletBinding()]

                              Param ([Int64]$interval)

                           

                              $minutes = [Int64](($interval/1000)/60)

                              $seconds = [Int64](($interval/1000) - ($minutes * 60))

                              $timestamp = ([DateTime]"01/01/1601").AddMinutes($minutes)

                              $timestamp = ([DateTime]$timestamp).AddSeconds($seconds)

                           

                              $timezone = (Get-WmiObject Win32_Timezone).Caption

                           

                              If ($timezone -like "(UTC-05:00)*")

                              {

                                  $timestamp = $timestamp.AddHours(-5)

                                  Write-Host -ForegroundColor Green "$($timestamp) is in EST)"

                              }

                              ElseIf ($timezone -like "(UTC-06:00)*")

                              {

                                  $timestamp = $timestamp.AddHours(-6)

                                  Write-Host -ForegroundColor Green "$($timestamp) is in CST)"

                              }

                              ElseIf ($timezone -like "(UTC-07:00)*")

                              {

                                  $timestamp = $timestamp.AddHours(-7)

                                  Write-Host -ForegroundColor Green "$($timestamp) is in MST)"

                              }

                              ElseIf ($timezone -like "(UTC-08:00)*")

                              {

                                  $timestamp = $timestamp.AddHours(-8)

                                  Write-Host -ForegroundColor Green "$($timestamp) is in PST)"

                              }

                           

                           

                          }