[Release] Time And Date Display [OLD]

This post has been moved.

2 Likes

is there any way to switch to server time instead of real time

It wil get the os.time so the time of the server it is running on.

nice work

Hey, thanks for reporting and making a fix.

1 Like

Can the formatting be changed, ie some people use DD/MM/YYYY, and other people use MM/DD/YYYY. So, 18/06/2022, or, 06/18/2022.

if you want to change that, go to the server.lua and then change it to this:

Citizen.CreateThread(function()
    while true do
        Wait(5000)
        local time = nil
        if Config.ShowAll == true or (Config.ShowOnlyTime and Config.ShowOnlyDate) then
            time = os.date("%m/%d/%Y at %H:%M")
        elseif Config.ShowOnlyTime then
            time = os.date("%H:%M")
        elseif Config.ShowOnlyDate then
            time = os.date("%m/%d/%Y") 
        else
            time = "Something must be displayed, Change this in the config!"
            print('Something must be displayed, Change this in the config!')
        end
        TriggerClientEvent('TimeAndDate-Display', -1, time)
    end
end)
1 Like