How to change Date and Time settings on Google Cloud Instance? - date

I am trying to change Date and time settings to UTC+10 Canberra,Sydney,Melbourne on the instance but it always keep rolling back to UTC+00 Monrovio, Reykjavik. Doesn't matter even if I select set time zone to automatic.enter image description here

The zone "australia-southeast1-b" on the provided screenshot is a deployment area for Google Cloud Platform resources, where the physical hosts, your VM instance is running on, are physically located. This is a geographical zone. It is not relevant to time.
To configure Date and Time in Windows, you should:
set correct time zone in Windows and
make sure a time server is reachable
Google Cloud Engine VM instance is just a virtual machine that boots up with hardware clock set to UTC as many modern servers do nowadays.
If you looked at the VM instance logs in the GCP Console you'd see that VM BIOS reports time in UTC
2019/10/3 14:9:44 Begin firmware boot time
After a while BIOS hands over to the bootloader
2019/10/3 14:9:45 End firmware boot time
Booting from Hard Disk 0...
The OS boots up. Behind the scene the OS time service recognizes the system timezone, then sets up and synchronizes time with the time source. From that time forward running programs and services report events based on the local system time:
...
2019/10/03 09:10:05 GCEWindowsAgent: GCE Agent Started (version 4.6.0#1)
In the Windows Event Log you should see entries made by the Time-Service:
Log Name: System
Source: Time-Service
Level: Information
The time provider NtpClient is currently receiving valid time data from metadata.google.internal,0x1 (ntp.m|0x1|0.0.0.0:123->169.254.169.254:123).
The time service is now synchronizing the system time with the time source metadata.google.internal,0x1 (ntp.m|0x1|0.0.0.0:123->169.254.169.254:123).
In the command prompt you can ensure that the time configuration and state are correct:
C:\Users\user>systeminfo | find /i "Time"
System Boot Time: 10/3/2019, 9:09:49 AM
Time Zone: (UTC-06:00) Central Time (US & Canada)
Hence you don't need synchronizing time neither manually or with any startup script. The time service will do this for you: synchronize the system time shortly after the system boot and keep it in sync afterwards.
All you need is to set correct Time zone and the Internet time server for Windows, and then make sure the time server is reachable via the network.
If you can't wait for the timesync cycle completion, you can logon to Windows and force time synchronization manually:
net stop W32Time
net start W32Time
w32tm /resync /force

To O.P
Answer to your question if I understand correctly, your answer is:
timedatectl set-timezone "Australia/Melbourne"

Related

Issue with timedatectl

Hi can any help me how timedatctl works
my understanding are
if system clock sysnc with NTP serivce through internet system time will be updated to current date and time.
If system clock sync with NTP it will update the RTC every 11 min is this right ?
but my observation :
please find the image where i tested by disabling the NTP serves
After enabling NTP service only local + Universal time got updated but Not RTC time why ?

PHP time() returns a timestamp that is 59 seconds behind real time

I have a dev environment and a production environment. The time() function returns the correct timestamp in my dev env but in my production environment time() is exactly 59 seconds behind!
The version of PHP is 7.0.3 on both environments.
This can't be a timezone issue since the difference is only one minute and the PHP default timezone is the same in both environments (America/Los Angeles).
It is now 10:48:29 am and here is the output from calling this function simultaneously in both environments (or at least as fast as I can press enter on the console).
Dev environment (is correct)
php > echo date('h:i:s A');
10:48:29 AM
Production environment (is one minute behind)
echo date('h:i:s A');
10:47:31 AM
Same happens with the time() function
Dev environment (is correct)
php > echo time();
1568742851
Production environment (is one minute behind)
echo time();
1568742792
And 1568742851 - 1568742792 = 59 secs
I know i could just add 59 seconds to the timestamp time() returns but that just seems like a hack and does not solve the problem. I would like to please get advice as to how to fix my production environment.
Confirm that you are allowing NTP traffic to your production OS environment. You can confirm that your server is properly communicating to NTP by running the following command ntpq -c peers If you receive a Connection refused prompt you don't have proper connectivity. You will need to configure an inbound firewall rule allowing UDP traffic on port 123. Once this is done, restart your NTP service service ntpd restart and rerun the ntpq -c peers command
I believe the system clock on your production and dev machine is unsync, Regardless of the version of PHP or Operating System, Just like #g_bor mentioned in comment.
Don't get confused by the time zone, Just run the command date +%s on system shell to print timestamp on both machines, If you have no permission (can't login with ssh), You can prepare the PHP file which contains system('date +%s');, And then, Upload to your web server and open the browser to check the timestamps on both your machines.

SCCM 1802 - Scheduled deployment WOL not working, but RightClickTools WOL works

I have been trying to figure out why Wake On Lan works for Right Click Tools, but not for SCCM Scheduled Deployments.
In the wolmgr.log file I found this happening every five seconds: "Failed to get WOL inbox on AMT Proxy component. Wait 5 seconds... SMS_WAKEONLAN_MANAGER 9/19/2018 11:32:24 AM 480 (0x01E0)".
In the wolcmgr.log file I don't see any errors except this happening about four times a day, which I think is referring to the endless errors shown in the other log file: "CBaseCounter::Initialize - Registered performance counter "Total Number of Packets failed" SMS_WAKEONLAN_COMMUNICATION_MANAGER 9/19/2018 2:01:59 AM 9496 (0x2518)"
I have tried to look up these error messages and haven't found anything to help me get this resolved.
I have tried various ports, including the default (9) and 12287, currently it is on 7. We are being told to use subnet directed broadcasts by our network team due to some limitations with our Cisco network configuration.
I do have a SQL Server Agent (ADK) service that was disabled. I enabled it and it starts but turns off immediately. I don't know if that is related at all. I did have some deployment issues with Windows 7 drivers giving errors during the task sequence, even though they were installing. So I installed a Windows 8.1 ADK after seeing an article about bugs with the latest Win10 ADK and SCCM Task Sequences installing Win7 drivers. I've since then installed Win10 1703 ADK, which works on one of my other SCCM servers on Win7 deployments fine, and I was having this WOL problem before installing 1703 ADK.
Under Administration > System Status > Site Status > Management Point, when I show messages I see these:
*Description Severity
Type Site code
Date / Time System
Component Message ID
Thread ID Process ID
The Wake On LAN component has failed to read the site control file settings. Possible cause: The information is not yet available. Solution: The component is waiting for the information to become available and will retry obtaining the information at its next interval. Error
Milestone CML
9/20/2018 12:47:56 PM SMS_WAKEONLAN_MANAGER
6500 3384
3988
Description Severity
Type Site code
Date / Time System
Component Message ID
Thread ID Process ID
The Wake On LAN component has failed to read the site control file settings. Possible cause: The information is not yet available. Solution: The component is waiting for the information to become available and will retry obtaining the information at its next interval. Error
Milestone CML
9/20/2018 9:39:03 AM SMS_WAKEONLAN_MANAGER
6500 2924
2636*
ADK SQL Server Agent
SCCM WOL configuration
WOL ports
wolmgr.log file screen shot
RightClickTools WOL Configuration

Change timezone for IBM Bluemix/Cloud Cloud foundry app

I have a Python application running as a Cloud Foundry app.
The timezone for the entire container/vm for my application is UTC, even though it is deployed in the US south region.
It's not just that messages in the log files are from the future, but some parts of the application rely on the current time. I tried to change the time zone via SSH from the application's management page but of course I do not have permissions.
I notice something similar on DSX.
Questions:
How do I change the time zone for the application and the container/vm it is running in?
Shouldn't the timezone be set to whatever region it is deployed in?

Wait for system to sync time before performing another task

I'm using a Raspberry Pi, and upon startup it's sending an e-mail with the time and an IP address. The problem is that the time is not correct, it's the time from last time the system was shut down. When I log in through ssh and do a date command, I get the correct time. In other words, the e-mail is sent before the system has updated its time.
I was thinking of automatically running ntpdate on boot, but after reading up on it it seems like a bad idea due to the many risks of error.
So, can I somehow wait until the time has been uppdated before continuing in a script?
There is a tool included in the ntp reference implementation for this very purpose. The utility has a rather cryptic name: ntp-wait. Five minutes with the man page and you will be all set.