Jump to content

Date Library modify - (Moved)


Recommended Posts

When i am including Date library to work on date or month or week. normally its start at GMT 00. at mid night 12AM. Sometimes i need to count start of day or date from GMT + 6 ( ) because i need at my local time (GMT + 6)

Normal Date Library Does:
Example:
GMT 23:59  @MDAY 8
Next GMT: 01  @MDAY 9

 

I need to modify Date library or any custom made library if possible

   
    GMT 23:59  @MDAY 8
   Next GMT 12: 01  @MDAY 8
   Next: GMT 5:59AM @MDAY 8
   Next: GMT 6:01AM @MDAY 9

Thanks in advance

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate AutoIt General Help and Support forum, as the AutoIt Example Scripts forum very clearly states:

Quote

Share your cool AutoIt scripts, UDFs and applications with others.


Do not post general support questions here, instead use the AutoIt Help and Support forums.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

It's not quite clear to me what you're asking to do. Do you have some code as an example that shows what you're trying to do, and where the error is?

 

You probably want to look into this function: https://www.autoitscript.com/autoit3/docs/libfunctions/_Date_Time_SystemTimeToTzSpecificLocalTime.htm

You can convert the GMT times to your local time, or a local time to GMT: https://www.autoitscript.com/autoit3/docs/libfunctions/_Date_Time_TzSpecificLocalTimeToSystemTime.htm

 

We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

Actually i had no idea about the system time actually. i think now i realized the scenario of real time (System Time) and local time. i am electronics background person in real. i am kind of noob on programming. i can do basic program only. so maybe i ask wrong, for that pardon me. i will say, how i will try if i dont have the idea what is the declaration it is actually. i did try after your comment. but not working what i wanted to actually.

Do i have to change the time or date everytime ? i want to count everything on system time actually

 

#include <AutoItConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
;#include "ImageSearch.au3"
#include <Date.au3>

AutoItSetOption('MouseCoordMode', 0)

;HotKeySet("p", "Image")
HotKeySet("`", "_Terminate")

Global $SleepFast = 500, $SleepNormal = 1000, $Sleepsec =1000, $Sec = 1000, $Min = 60000, $Hour = 360000
;Local $Startech, $StartechX, $StartechY, $NetFlix, $NetFlixX, $NetFlixY

Local $tLocal, $tSystem

$tLocal = _Date_Time_GetLocalTime()
$tSystem = _Date_Time_TzSpecificLocalTimeToSystemTime($tLocal)

While 1
    If @HOUR = '5' Then             ; everywhere Count need to be on system time
        MsgBox($MB_SYSTEMMODAL, "Title", "hour found", 10)
    ElseIf @MDAY = '5' Then
        MsgBox($MB_SYSTEMMODAL, "Title", "Date found", 10)
    Else
        Sleep(10)
    EndIf
WEnd

Func _Terminate()
   MsgBox($MB_SYSTEMMODAL, "Info :", "Script terminated by User" & @CRLF)
    Exit
 EndFunc   ;==>_Terminate

 

Link to comment
Share on other sites

I still don't know what you're actually trying to do. Can you gives details on what you're trying to accomplish? What is your end goal, your purpose? Are you trying to create a timer/alert at a certain time of day? Trying to do something every x amount of seconds/minutes/hours?

@HOUR and @MDAY (or any macro) are YOUR computer/local time, you do not need to do anything with _Date_Time_* for those. By the way the 'SystemTime' that it refers to is actually UTC/GMT time (https://time.is/UTC).

 

 

We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...