public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Getting different times with or without --login
@ 2013-10-09 15:09 Francesco Pizzolante
  2013-10-09 15:17 ` Csaba Raduly
  0 siblings, 1 reply; 2+ messages in thread
From: Francesco Pizzolante @ 2013-10-09 15:09 UTC (permalink / raw)
  To: cygwin

Hi,

I noticed that I'm getting different times from the command line when use
--login or not.

Here's a simple test.

1. Start from a Windows command prompt and start bash with "bash --login". In
   this case, I can see that the TZ variable is set to "Europe/Brussels".

   If I run date, I get "Wed, Oct 09, 2013  5:00:52 PM", while running the
   following command "emacs -Q --batch --eval '(message "%s"
   (format-time-string "%H:%M"))'" returns "16:00" (I get a difference of one
   hour).

2. Start from a Windows command prompt and start bash with "bash". In this
   case, the TZ variable is not set (no profile loaded).

   In this case, the 2 previous commands return the same correct time.

Note that the "date" command returns the correct time in any case (with and
without --login), while the emacs command returns the correct time only when
--login is not used (I'm using a Windows version of Emacs, 24.3). I have no
issue when using the Cygwin version of Emacs.

I don't understand what's wrong in my configuration. Everything should be fine
even when using the "bash --login" command to start Cygwin (this is the what
the standard cygwin.bat batch file does).

Any hint is welcome.

Thanks a lot.

 Francesco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Getting different times with or without --login
  2013-10-09 15:09 Getting different times with or without --login Francesco Pizzolante
@ 2013-10-09 15:17 ` Csaba Raduly
  0 siblings, 0 replies; 2+ messages in thread
From: Csaba Raduly @ 2013-10-09 15:17 UTC (permalink / raw)
  To: cygwin list

Hi Francesco

On Wed, Oct 9, 2013 at 5:11 PM, Francesco Pizzolante  wrote:
> Hi,
>
> I noticed that I'm getting different times from the command line when use
> --login or not.
>

Bash executes different startup scripts depending on whether it was
started with --login or not, so the results may also be different.

You can read the gory details here:
https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-09 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-09 15:09 Getting different times with or without --login Francesco Pizzolante
2013-10-09 15:17 ` Csaba Raduly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).