Tag Info

Hot answers tagged

34

Usually you'll want to have the time set automatically, and in that case, you'll want to set up ntpd to automatically set the time for you. The specifics differ slightly from distribution to distribution, but if you're running Ubuntu, for instance, there's a guide on setting up NTP on Ubuntu. Otherwise, just Google ntpd <distribution-name>, and ...


34

As described in Microsoft KB 214058: Days of the week before March 1, 1900 are incorrect in Excel MORE INFORMATION When the date system in Microsoft Excel was originally created, it was designed to be fully compatible with date systems used by other spreadsheet programs. However, in this date system, the year 1900 is incorrectly ...


17

Just use the date command with -d option: $ date -d "1983-08-04 348 days" Tue Jul 17 00:00:00 BST 1984 You can change the output format if you want: $ date -d "1983-08-04 2 days" +%Y-%m-%d 1983-08-06


15

You can do this with date +%s For more possibilities, see man date


15

You'll need to do string parsing, then pass an appropriate formatted value into DATEVALUE – something like this: =DATEVALUE(RIGHT(A1,2)&"-"&MID(A1,6,3)&"-"&LEFT(A1,4)) (edit: updated formula - tested and it works for me on one example - may need to refine depending on your input)


15

Yes. You can even do it over a LAN. The CIFS transaction is TRANS2_QFSINFO and the information level is SMB_QUERY_FS_VOLUME_INFO. The native Windows NT API function for querying a volume's creation time is ZwQueryVolumeInformationFile(), which yields a FILE_FS_VOLUME_INFORMATION data structure (almost identical to the CIFS one, note) when asked for the ...


14

I kept experimenting till I figured out that vim was expanding the "%" character. So just escape "\%" and every thing works as I expected. :r!date "+\%F" 2012-07-20 Now I can put dates into files Like I would like to :r!date "+\%F" -d "-2 day" 2012-07-18


12

What you want is to use a custom format. Just type it in the box. Click for full size


12

IMHO you are making something simple needlessly complex. Why not just do something simple like. NEWDIR=$(date -R);mkdir "$NEWDIR";cd "$NEWDIR"


12

It's 6pm in Taipei, what time is it here? date --date='TZ="Asia/Taipei" 18:00' Fri Jul 16 11:00:00 BST 2010 At 11am here in London, what time is it in Taipei? TZ=Asia/Taipei date -d "11:00 BST" Fri Jul 16 18:00:00 CST 2010


12

Make sure you have not changed your taskbar to use small icons only. This removes the date from the taskbar and only shows the time. Right Click Taskbar Properties Use small icons


11

=TODAY() + 7*12 or in general, =TODAY() + 7*(no of weeks)


11

This Bash function works for me on a GNU-based system: jul () { date -d "$1-01-01 +$2 days -1 day" "+%Y%m%d"; } Some examples: $ y=2011; od=0; for d in {-4..4} 59 60 {364..366} 425 426; do (( d > od + 1)) && echo; printf "%3s " $d; jul $y $d; od=$d; done -4 20101227 -3 20101228 -2 20101229 -1 20101230 0 20101231 1 20110101 2 20110102 ...


11

Set the Hardware Clock to the current System Time. # hwclock --systohc Set the System Time from the Hardware Clock. # hwclock --hctosys


11

The problem is not how you can use date to output what you want... your problem is: This way I'd like to get the old logfiles out of my way, but still have 5-6 days of logfiles around. So, why not using find to remove all files but this week's? find /path/to/files/ -mtime +7 -exec rm {} \; In addition, date has many different implementations - I ...


10

Handles leap years: @echo off & setlocal set year=%1 if "%year%"=="" set /p year=Year? if "%year%"=="" goto :eof set /a mod=year %% 400 if %mod%==0 set leap=1 && goto :mkyear set /a mod=year %% 100 if %mod%==0 set leap=0 && goto :mkyear set /a mod=year %% 4 if %mod%==0 set leap=1 && goto :mkyear set leap=0 :mkyear call :mkmonth ...


10

In order to do what you are looking for, a simple script (as @Ignacio pointed out) should do the trick: while true do echo "$(date '+TIME:%H:%M:%S') $(ps aux | grep "pattern" | wc -l)" | tee -a logfile sleep 2 done I use tee instead of >> so that you can see the output on your terminal as well as capture it in your log.


10

tar cfz backup-$(date +%Y-%m-%d).tar.gz ... man strftime or man date to see what %-escapes can be used with date.


9

The only way I can think of is to change the date format. Open Control Panel->Clock, Language, Region->Change the date, time, or number format->Additional Settings...->Date tab Prepend dddd to the Short date: format You'll then see the day name in the tray clock. Of course, this will change the short date format throughout the OS, which may or may ...


8

If the date cells are all in one column, here's a quick and dirty way: Assuming the dates are in A1 downwards, insert two columns to the right. In B1, put the formula: =DATE(YEAR(A1)-4,MONTH(A1), DAY(A1)) Copy this formula down the column to recalculate all the dates from column A. Now select and 'copy' column B (the new dates) and use 'paste as ...


8

Vim has an internal strftime() function. Try this (in insert mode): <C-r>=strftime('%F')<CR>


8

There is no "volume creation date" that I know of built-in to NTFS. However, you should be able to approximate the creation date quite closely by looking at the creation date of the System Volume Information directory in the root of the volume.


7

Here is the reason explained by Joel himself: My First BillG Review Basic uses December 31, 1899 as the epoch instead of January 1, 1900, but for some reason, today's date was the same in Excel as it was in Basic. Huh? I went to find an Excel developer who was old enough to remember why. Ed Fries seemed to know the answer. "Oh," he ...


7

This can easily be done using watch too without using any scripts. watch -t -n 10 "(date '+TIME:%H:%M:%S' ; ps aux | grep "pattern" | wc -l) | tee -a logfile"


7

Right click the Date field button. Choose Group and Show Detail | Group In the Grouping dialog box, select Days from the 'By' list. For 'Number of days', select 7 The week range is determined by the date in the 'Starting at' box, so adjust this if necessary. In the example below, December 29, 2003 (a Monday), was entered as the starting date. Click OK ...


7

You can use SetFile on the command line to do this however it is not included by default in Mac OS X 10.4.x (Tiger). If you have installed the Developer Tools or most of the Combo updates it is installed but in a non standard location. SetFile was included in /usr/bin/ for Mac OS X 10.5 and later. To find the command you can try using locate to find the ...


6

It's not necessarily going to speed up time, but it can be useful for debugging. Nirsoft's RunAsDate From the site: RunAsDate is a small utility that allows you to run a program in the date and time that you specify. This utility doesn't change the current system date and time of your computer, but it only injects the date/time that you specify into ...


6

Simply make the Taskbar a little bigger and it will display the date. In addition, I am not sure, but will look up and see if there is a registry hack or alternative way to do it without stretching the bar.


6

With Windows 7 or Vista (32-bit or 64-bit) and small icons you can show both the date and time using the free program Skinny Clock from www.rawos.com/sclock/ or Softpedia. I have ver 1.15 Beta 1, which needs tweaking for optimum results. Set autoload (right-click the icon in the Taskbar, Settings, General, tick Autorun). Disable the Clock Window (Settings, ...


6

In 2003, go to the Tools Menus, then choose Options, then choose the Calculation tab. Select/Unselect the box to change the date setting.



Only top voted, non community-wiki answers of a minimum length are eligible