ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

simple time zone question

November 04, 2012 1:59pm

Subscribe [3]
  • #1 / Nov 04, 2012 1:59pm

    thefifthlion

    133 posts

    Simple question,

    I want to display the time based on the time zone of my clients headquarters despite who views the site. If they are over seas I want them to see what time it is here EST. How is this accomplished?

    Not sure if my server is in the same time zone as my client or not.

  • #2 / Nov 04, 2012 3:29pm

    Enviromed

    375 posts

  • #3 / Nov 06, 2012 10:43am

    Shane Eckert

    7174 posts

    Hey thefifthlion,

    Thank you for posting your question.

    What do you think of the Localize Date Add-On that Enviromed has mentioned? Looks like it may do the job.

    Please let us know!

    Cheers,

  • #4 / Nov 06, 2012 10:53am

    thefifthlion

    133 posts

    I think my question is a little more basic. I want to show the current time based on a time zone. I as assuming it would look like this?

    {current_time zone="EST" format="%g:%i"}

  • #5 / Nov 07, 2012 11:19am

    Shane Eckert

    7174 posts

    Hey thefifthlion,

    zone= is not a valid parameter. Where did you see that?

    You would probably need to use %Q which is local server time zone offset, in hours and seconds, against GMT. Or you can use %O which is the difference to Greenwich time (GMT) in hours.

    Does that make sense?

    Cheers,

  • #6 / Nov 07, 2012 12:13pm

    thefifthlion

    133 posts

    I was just guessing. It seems like the options you listed would work. I’ll see if I can figure out the offset from GMT.

  • #7 / Nov 07, 2012 1:08pm

    Shane Eckert

    7174 posts

    Hey thefifthlion,

    Sounds good.

    Is there anything else I can help with?

    Cheers,

  • #8 / Nov 07, 2012 9:14pm

    thefifthlion

    133 posts

    Just thought I would share my solution for any else new to this sort of thing. I had used {current_time format="%g %i"} and it was outputting a time that was an hour off. Then I realized the time must be based on the time zone of my server’s location. So I went into my control panel under “localization settings” and offset the time “-60 minutes” to correct for my clients time zone and now everything works great.

    thanks,
    leo

  • #9 / Nov 08, 2012 2:53pm

    Shane Eckert

    7174 posts

    Hey leo,

    Thanks for letting us know!!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases