WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

Does current_time('timestamp') have an issue?

I am trying to get the current_time('timestamp'), and instead of giving me my current time:

Jun 26 2013 14:30

It gives me:

Jun 26 2013 21:30

I tried to check the seconds, and it gives me:


Which is correct for the time given, but not for the real current time. What's happening?

share|improve this question

The output of current_time('timestamp') should be

time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );

according to WP 3.5.2, so you should check your get_option( 'gmt_offset' ) settings.

Also current_time('timestamp', 1 ) should give you time().

share|improve this answer
Thanks +1 for the help. – Franz Noel Jun 26 '13 at 22:11
you're welcome, the date/time stuff can be confusing in PHP and WP :-) – birgire Jun 26 '13 at 22:16
up vote 1 down vote accepted

It's a WP non-code programming thinking error.

Under General Settings > Timezone

It should be set to your own timezone.

share|improve this answer

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.