Copyright © if not true then false. All Rights Reserved. Snowblind by Themes by bavotasan.com. Powered by WordPress.

Posts Tagged ‘ time ’
Apache Applications Bash CentOS Coding Command line CSS Database date Fedora Firefox Gnome Google Hacked Howto HTML Java JavaScript KDE Links Linux MySQL News Perl PHP PostgreSQL PostgreSQL Partitioning Programming Programs psql Red Hat RHEL Security SQL Styles Terminal time Tips Tricks Tweets Twitter UNIX Windows XFCE Yum
I was using simple function to calculate difference between two dates and timestamps until I noticed, it’s not working correctly in long intervals. It’s very easy to calculate difference between two timestamps in seconds, but it’s much more complicated print difference in human readable format. The Internet can be found in a wide range of ways to do this thing, but as a rule they use a fixed amount of seconds for the year and the month. So if we calculate year with using 365 or 365.25 days and month using 30 or 31 then the difference is not accurate, because of leap years, DST (Daylight Saving Time) and so on.
Because of this problem, I decided to make a function (at least in the short testing) to return the right kind of differences between the UNIX timestamps and dates in human readable format. This function uses PHP strtotime function to calculate real differences and can handle leap years and DST. This function can also return Twitter like about texts with precision parameter.
» Continue Reading "PHP: Calculate Real Differences Between Two Dates or Timestamps"

This tip is really useful if you need/want to monitor multiple servers at the same time. This Tip works, as the tip, by which you can add the date and time the title of the Linux terminal, but it adds more usefull info to terminal title. Following bash one liner add hostname, date, time, uptime, users and load Average to Linux Terminal Title and updates it every second.
This trick works at least following terminals: Gnome Terminal, xterm, urxvt, rxvt.
Add hostname, date, time, uptime, users and load Average to Linux Terminal Title
Simply type the following command line:
while sleep 1;do echo -ne '\033]2;'`/bin/hostname`' - '`date +\%a\ %b\ %d`', '`/usr/bin/uptime`'\007';done&
» Continue Reading "Add Hostname, Date, Time, Uptime, Load Average to Linux Terminal Title"

Here is easy way add date and time to Linux terminal title. This trick works at least following terminals Gnome Terminal, xterm, urxvt, rxvt.
Simply type the following command line:
while sleep 1 ; do echo -ne '\033]2;'`date`'\007'; done &

