Jump to content
  • 0

GMT Date & Time


FangYX

Question

Posted

How to make os.date working with gmt?

Or

Does anyone have raw date & time site that working with gmt?

3 answers to this question

Recommended Posts

Posted
19 hours ago, Fathoni267 said:

How to make os.date working with gmt?

I've found the code!

GMT+0

os.date("!%Y-%m-%d %X")

GMT+7

os.date("!%Y-%m-%d %X", os.time()+7*60*60)

 

Posted
Just now, Fathoni267 said:

I've found the code!

GMT+0


os.date("!%Y-%m-%d %X")

GMT+7


os.date("!%Y-%m-%d %X", os.time()+7*60*60)

 

Oh I just realized. It's only based with local time, so it can still be manipulated:(

Posted

I figured out how to prevent local date from being changed

Date = os.date("!%a, %d %b %Y %H:%M")
gg.sleep(100) --This is for matching the local date with online date
if Date ~= string.match(gg.accessLink("https://exemple.com").headers["Date"][1], ("(.*):")) then --You can replace the website with anything but the website can still be accessed
gg.alert("🕓 Invalid Date/Time 🕓") print("🕓 Set your date/time correctly 🕓") return else
Date = os.date("!%Y/%m/%d %X", --You can change it as your date format
os.time()+7*60*60) --This is for GMT+7
end

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.