Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I having an strange situation,
in futon, the JavaSCript shell is returning date time in GMT+8,
which is inline with the server timezone.

However, when I tail the log file,
it is showing GMT -3, 11 hours difference.

I'm suspecting there is a configuration somewhere to fix this issue.
Anyone has an idea?

OS:- CentOS release 5.7 (2.6.18-194.11.4.el5)
Couchdb version :- Apache CouchDB 1.1.1
Erlang :- V5.8.1 (R14B (erts-5.8.1)) Log format:-

[Sun, 04 Dec 2011 04:10:06 GMT] [info] [<0.19767.816>] IP - - 'GET' URL 200

Current server time is 3pm

Here is the screen capture :-

Eshell V5.8.1  (abort with ^G)
1> {Date={Year,Month,Day},Time={Hour,Minutes,Seconds}} = erlang:localtime().

[root@localhost] ~ >> date
Tue Dec  6 09:56:41 SGT 2011

Here is the result of date :-

date && date -u
Tue Dec  6 12:03:35 SGT 2011
Tue Dec  6 04:03:35 UTC 2011

NOTE: I might confuse over the GMT log format (likely my wrong interpretation)

@JeffSnider - I think you are close, most likely is my mis-understanding originally

1> httpd_util:rfc1123_date().
"Tue, 06 Dec 2011 04:09:19 GMT"
share|improve this question
What is the OS that couchdb is running on? Can you provide an example of the time as it appears in the log? What version of couchdb? What version of erlang? – Jeff Snider Dec 4 '11 at 4:52
Could you run "date;date -u" and add that output? – Jeff Snider Dec 5 '11 at 19:08
This may be easier to work on over instant messages and include the solution here after we've sorted it out. Would that be ok? – Jeff Snider Dec 6 '11 at 3:59
Give httpd_util:rfc1123_date(). a shot in erl too. That is the specific function that couchdb uses in its log writer function. – Jeff Snider Dec 6 '11 at 4:08
@JeffSnider - looks like the GMT offset? (previously there is 11 hours difference, but now is 8 hr, I hugely suspect I seeing something wrong previously)' – ajreal Dec 6 '11 at 4:08
up vote 0 down vote accepted

I suspect it is the clock or timezone settings at the os level rather than a couchdb or erlang configuration issue. If your clock and timezone is correct (the date command I asked for show that for sure) then I would like to look into the environment that beam is running with. There could be a hint there.

I know that's not the answer you're hoping for but from what I can tell, there isn't a configuration for couch or erlang that would control this. The date and time in the log is retrieved from the built in erlang library httpd_util using the rfc1123_date() function. I haven't been able to find anything that would make that return anything but the time in GMT.

share|improve this answer
Sorry for another PEBKAC problem, your step-by-step lead to solution – ajreal Dec 8 '11 at 3:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.