Jump to content

Recommended Posts

Posted (edited)

Hi guys, i want to convert WebKit/Chrome timestamps that i've found in chrome cookie database to Human-Readable time (if possible, with UTC or GMT offset).

  • Example of WebKit/Chrome timestamp13228999534132232
  • Output that i want: 2020-03-18 20:16:56

This site has a tool to do this work, but i wonder how to convert this time (this timestamp's time bases are 1600/01/01) to human-readable time:

https://www.epochconverter.com/webkit

Edited by Colduction

I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
35 minutes ago, Colduction said:

Output that i want: 2020-03-18 20:16:56

Think the output should be  "March 18, 2020 10:05:34 AM" GMT according that website and this script should get that:

#include<Date.au3>
$timestamp = 13228999534132232
$sNewDate = _DateAdd('s', Int($timestamp/1000000+.5), "1601/01/01 00:00:00")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sNewDate = ' & $sNewDate & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Posted (edited)
#include <Date.au3>
Global $EPOCHtime = 13228999534132232 / 1000000 ; <== microseconds to seconds

Global $aTimeZoneInfo = _Date_Time_GetTimeZoneInformation() ; ***
$EPOCHtime -= $aTimeZoneInfo[1] * 60 ; ***

Global $sDateTime = _DateAdd('s', Int($EPOCHtime), "1601/01/01 00:00:00")
ConsoleWrite('$sDateTime = ' & StringRegExpReplace($sDateTime, "(\d{4})/(\d{2})/(\d{2})", "${1}-${2}-${3}") & @CRLF)

EDIT : Hmm, probably the TimeZone information is even counterproductive here. Comment this part out if necessary, which would then correspond exactly to @Jos suggestion :lol:.

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites
1 hour ago, Nine said:

So what have you tried so far ?

I tried to division by 1600xxx and division by 10000xxxxx, then string format with 1600/01/01 :/


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
1 hour ago, Jos said:

Think the output should be  "March 18, 2020 10:05:34 AM" GMT

Thanks @Jos, it's correct! thanks for your help, before you i've just divisioned by 1600xxxx and 10000xxxxx, then string format with 1600/01/01


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
1 hour ago, Danp2 said:

Try searching the forum for the term "epoch" for multiple examples

No similar and useful topic found


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
Posted (edited)

Hi @Musashi, thanks for your fish :)
Your code is correct for GMT

The @Jos's code was for UTC as you told

I thank to both of you :)❤

Edited by Colduction

I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
1 minute ago, Danp2 said:

different than mine

Link your topic


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
Just now, Danp2 said:

No point

Then we conclude that there was no similar topic with this one :)

Anyway, thanks for your reply :)❤


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
Posted (edited)

Okay @Danp2, you are right! and i'm blind 😐
then show your similar topic to blind man.

Edited by Colduction

I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
Posted (edited)
7 minutes ago, Nine said:

Glad to see. He changed his avatar, but he is BACK ! 

I've been banned from AutoIt forum, because of delay to answer a question (but i was not online to give answer).

Have you a problem with my account history?

Edited by Colduction

I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
5 minutes ago, Danp2 said:

@Colduction https://www.autoitscript.com/forum/search/?q=epoch

P.S. In case you couldn't find it, the search box looks like this -- image.png.32d98c361b7cc040d15e05978b633cdd.png

I know that there is a search button in this site, but someone in other forums wrote about Chrome and he divided by 1600xxxx and 1000xxxx, i was think that these topics in AutoIt Forum was not useful 😕 Just this.


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Jahar
      Hi All,
      Please help me on how to fetch date/time of last windows 10 system restore point using autoit? Basically its about querying the last restore point.
    • By TheDcoder
      Hi everyone,
      I am bit stumped as to why I am not able to set the time in the Date control
      #include <DateTimeConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("My GUI get date", 200, 200, 800, 200) Local $idDate = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20, $DTS_TIMEFORMAT) ; to select a specific default format Local $sStyle = "HH:mm:ss" GUICtrlSendMsg($idDate, $DTM_SETFORMATW, 0, $sStyle) ; Set time Local $iRet = GUICtrlSetData($idDate, '13:33:37') ConsoleWrite('GUICtrlSetData returned ' & ($iRet = 1 ? 'success' : 'failure') & @CRLF) GUISetState(@SW_SHOW) ; Loop until the user exits. While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox($MB_SYSTEMMODAL, "Time", GUICtrlRead($idDate)) EndFunc ;==>Example The documentation for GUICtrlSetData clearly mentions that it uses the same format as GUICtrlRead:
      But I get failure
      What gives?
      Thanks for the help in advance!
    • By Langmeister
      I am once again asking for your experienced assistance. If I open a website that uses notifications I am asked to allow or block them for that website after a few seconds. This notification pops up every time the page gets navigated to, even tho you have clicked on allow for several times. I am explicitly not searching for smth to get rid of "Chrome is being controlled by automated test sw". Instead I am searching for a line of script to disable all notifications by default: like here chrome://settings/content/notifications. 
      This is code should give you an example of what notifications I am talking about:
      #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sID _WD_Option("Driver", "C:\Program Files (x86)\AutoIt3\chromedriver.exe") _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://webradio.planetradio.de/") _WD_LoadWait($sSession)  
    • By Langmeister
      Hi, I need help performing actions in Salesforce using IE. I used to complete tasks via MouseMove/MouseClick etc. on the Chrome application of SF, but unfortunately this only works for me and not my colleagues due to different positions of things etc. Being unable to get Webdriver UDF or Chromedriver running to interact with the code directly, I chose to look into the IE UDF. ATM I'm trying to tick a specific checkbox in SF which simply allows me to "select all checkboxes" at the same time. Applying the following code on a random website with checkboxes works just fine for me: (in this case selecting cheese checkbox)
      #include <IE.au3> Local $oIE = _IECreate("http://www.echoecho.com/htmlforms09.htm") Local $oSubmit = _IEGetObjByName($oIE, "option3") _IEAction($oSubmit, "click") _IELoadWait($oIE) But applying it to the Salesforce website it does exactly nothing and responds with these warnings/errors:
      The script is exactly the same, except for website and the input name tag of the desired checkbox being different.
      #include <IE.au3> Local $oIE = _IECreate("Corporate Salesforce URL") Local $oSubmit = _IEGetObjByName($oIE, "myPage:myForm:oliListBlock:oliListTable:j_id36") _IEAction($oSubmit, "click") _IELoadWait($oIE) As its working with random websites my guess is that there has to be something done to get it work with SF.
      Hope the more experienced SF+AutoIt pros can help me out here. Thanks in advance!
    • By nooneclose
      I want wanting to run multiple tests on my company website. Sadly the process I want to automate requires opening a File Explorer to add an attachment. Is there a way in to automate a Chrome opened File Explorer?
      (I am using webdriver to automate the other 99% of the process just fine. But when I have it click on attach file and chrome opens a file explorer I do not know how to handle it.) 
      Any help would be greatly appreciated. 
×
×
  • Create New...