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

This is a strange question, but I want to know how I can access the Date and Time settings

Admin > Settings > General > Date Format
Admin > Settings > General > Time Format

I am using the Any+Time jQuery plugin as a date/time selector for the editor view for a custom post type. It allows you to specify a date and time format using the same settings WordPress does. Edit: Turns out it doesn't use the same Date part tokens that WordPress does. Lame.


Ideally I want to do something like this...

  $wpDateFormat = get_admin_settings('DateFormat');
  // $wpDateFormat now holds something like "F j, Y"

      format: '<?php echo $wpDateFormat ?>'

What I don't know is... is there such a function like get_admin_settings() ?

share|improve this question
up vote 26 down vote accepted
share|improve this answer
Thanks, turns out that the jQuery plugin uses different date and time tokens to specify format after all. So, while this doesn't solve my problem at hand, I appreciate you sharing for my future benefit. – jessegavin Aug 19 '10 at 19:23
very nice, thanks a lot... didnt knew i could do that :) – Sagive SEO Apr 4 '12 at 19:51

You want get_option(). In particular:

$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
share|improve this answer

Why don't you write a small PHP function that maps the WordPress format specifiers to the Any+Time™ specifiers? Then you can accomplish your goal :)

share|improve this answer
Someone has already written a conversion from php date() to strftime() format, and I think the MySQL format Any+Time uses is compatible with the latter. – Jan Fabry Oct 7 '10 at 21:10

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.