LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

BASH datetime for scripts

Posted 04-05-2020 at 05:16 PM by karanis
Tags bash, time

#!/bin/bash
dt=`date '+%d/%m/%Y %H:%M:%S'`
echo "$dt"
LQ Newbie
Posted in Uncategorized
Views 297 Comments 0 karanis is offline
Old

Set system time to HW clock (BIOS)

Posted 04-05-2020 at 04:24 PM by karanis
Updated 04-05-2020 at 04:26 PM by karanis (I didn`t mention to execute as root)
Tags ntp, time

# hwclock --systohc --localtime

You update your system time from ntp but sometimes, somehow, something happens and it can not sync to hardware clock as it should be and after reboot, you will need ntp again (with an internet connection).

This is a solution to sync ntp clock to BIOS but be aware that, your BIOS clock will need sync in 24 hours but if you do do not care about seconds, it will carry you along.

If you care about microseconds, hehe welcome...
LQ Newbie
Posted in Uncategorized
Views 245 Comments 0 karanis is offline

  



All times are GMT -5. The time now is 09:18 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration