Answers.Body: <p><code>{{ now|date("H:i", "Europe/Paris") }}</code></p>
  
  <p>As per: <a href="http://twig.sensiolabs.org/doc/filters/date.html" rel="noreferrer">http://twig.sensiolabs.org/doc/filters/date.html</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-23T12:45:02.190Z
Answers.Text: Hi, how to do this same in php, i want to fetch entries based on user timezone.
Answers.UserDisplayName: inrsaurabh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-25T16:52:52.170Z
Answers.LastActivityDate: 2015-11-25T16:52:52.170Z
Answers.UserDisplayName: andrew.welch
Answers.Body: <p>First define an array of all the timezones you want to output the time with, plus what their “Standard Time”/“Daylight Savings time” abbreviations are:</p>
  
  <pre><code>{% set locales = [
      { timezone: 'Australia/Sydney',    stAbbr: 'AEST', dstAbbr: 'AEDT' },
      { timezone: 'America/Los_Angeles', stAbbr: 'PST',  dstAbbr: 'PDT' },
      { timezone: 'America/New_York',    stAbbr: 'EST',  dstAbbr: 'EDT' },
      { timezone: 'Europe/London',       stAbbr: 'GMT',  dstAbbr: 'BST' },
  ] %}
  </code></pre>
  
  <p>Then loop through them, outputting your date in those timezones, plus showing the correct “Standard Time”/“Daylight Savings Time” abbreviation:</p>
  
  <pre><code>{% for locale in locales %}
      {# Output the date/time in this timezone #}
      {{ date()|date('F j ga', locale.timezone) }}
  
      {# Is that timezone currently observing Standard Time? #}
      {% if date()|date('I', locale.timezone) == '0' %}
          {{ locale.stAbbr }}
      {% else %}
          {{ locale.dstAbbr }}
      {% endif %}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-25T17:08:48.097Z
Answers.Text: Gives me the same time for every locale. I'm using {{ now|date("H:i", locale.timezone) }}. So for London the same time as New York.
Answers.UserDisplayName: Johannes Lamers
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-25T17:28:36.810Z
Answers.Text: @JohannesLamers What happens if you replace `now` with `date()`?
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-25T18:08:59.660Z
Answers.Text: Its working now with {{ date()|date("H:i", locale.timezone) }}
Answers.UserDisplayName: Johannes Lamers
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-25T23:34:30.717Z
Answers.Text: @JohannesLamers Cool, just updated the code to use `date()`.
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-25T16:56:18.297Z
Answers.LastActivityDate: 2015-11-25T23:34:05.267Z
Answers.LastEditDate: 2015-11-25T23:34:05.267Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>How can I get the current date / time for specific timezones?</p>
  
  <p>My local time is easy: </p>
  
  <pre><code>{{ now|date("H:i") }}
  </code></pre>
  
  <p>So how can I get this for New York? or Singapore?</p>
  
Tags: <templating><datetime><timezone>
Title: Get current date / time in specific timezone?
ThreadText: # Get current date / time in specific timezone?
  
  (Asked by: username_0 on 2015-11-25)
  
  How can I get the current date / time for specific timezones?
  
  My local time is easy:
  
  ```
  {{ now|date("H:i") }}
  
  ```
  
  So how can I get this for New York? or Singapore?
  
  **Tags:** templating, datetime, timezone
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2015-11-25. Score: 5 | Accepted answer
  
  First define an array of all the timezones you want to output the time with, plus what their “Standard Time”/“Daylight Savings time” abbreviations are:
  
  ```
  {% set locales = [
      { timezone: 'Australia/Sydney',    stAbbr: 'AEST', dstAbbr: 'AEDT' },
      { timezone: 'America/Los_Angeles', stAbbr: 'PST',  dstAbbr: 'PDT' },
      { timezone: 'America/New_York',    stAbbr: 'EST',  dstAbbr: 'EDT' },
      { timezone: 'Europe/London',       stAbbr: 'GMT',  dstAbbr: 'BST' },
  ] %}
  
  ```
  
  Then loop through them, outputting your date in those timezones, plus showing the correct “Standard Time”/“Daylight Savings Time” abbreviation:
  
  ```
  {% for locale in locales %}
      {# Output the date/time in this timezone #}
      {{ date()|date('F j ga', locale.timezone) }}
  
      {# Is that timezone currently observing Standard Time? #}
      {% if date()|date('I', locale.timezone) == '0' %}
          {{ locale.stAbbr }}
      {% else %}
          {{ locale.dstAbbr }}
      {% endif %}
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: Gives me the same time for every locale. I'm using {{ now|date("H:i", locale.timezone) }}. So for London the same time as New York.  
  > **username_3**: @username_0 What happens if you replace `now` with `date()`?  
  > **username_0**: Its working now with {{ date()|date("H:i", locale.timezone) }}  
  > **username_3**: @username_0 Cool, just updated the code to use `date()`.  
  
  ---
  
  ### Answer by username_1 on 2015-11-25. Score: 5
  
  `{{ now|date("H:i", "Europe/Paris") }}`
  
  As per: <http://twig.sensiolabs.org/doc/filters/date.html>
  
  > **Comments:**
  > **username_2**: Hi, how to do this same in php, i want to fetch entries based on user timezone.  
  
  ---
  
  