2

here's a oddity.

on Cygwin bash on Windows Vista, i can get date like this:

$ date
2010-11-30  4:40:48 AM PST

xah@xah-PC ~
$ date +%s
1291120855

but in emacs “shell”, running the same date command, i get this:

c:\Users\xah\web\xahlee_org\comp>which date
which date
/usr/bin/date

c:\Users\xah\web\xahlee_org\comp>date
date
The current date is: 2010-11-30 
Enter the new date: (yy-mm-dd) 


c:\Users\xah\web\xahlee_org\comp>date +%s
date +%s
The system cannot accept the date entered.
Enter the new date: (yy-mm-dd) 

any idea what's going on?

Xah Lee
  • 16,755
  • 9
  • 37
  • 43

2 Answers2

5

This is because your emacs shell is actually a Windows Command Prompt shell and the date command gets sent to it and fails.

Take a look at this question to find out how you can configure emacs to use Cygwin's bash shell instead:

How can I run Cygwin Bash Shell from within Emacs?

Community
  • 1
  • 1
dogbane
  • 266,786
  • 75
  • 396
  • 414
2

You're hitting cmd.exe's date builtin, which is in no way like POSIX date(1). You could work around this by typing in the full path to the date command that you want.

sorpigal
  • 25,504
  • 8
  • 57
  • 75