Thursday, 6 October 2005

Find the number of days elapsed since January 1st

To find out how many days have lapsed since January 1st. There is a easy method in Linux. That is using the cal command. For example, try the following :

$ cal -j 10 2005

October 2005
Sun Mon Tue Wed Thu Fri Sat
274
275 276 277 278 279 280 281
282 283 284 285 286 287 288
289 290 291 292 293 294 295
296 297 298 299 300 301 302
303 304

Since today is October 6th, as of January 1st 2005, 279 days have elapsed. The option -j displays the Julian date.

No comments:

Post a Comment