We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [timezone]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Fetch the entries based on local time zone

I am trying to fetch the entries based on the local timezone. $entries = Entry::find(); $entries->section('news'); $timezone = new \DateTimeZone(Craft::$app->getTimeZone()); // current site ...
1
vote
1answer
98 views

Assets Error: Unknown or bad format (years) at position 0 (y)

I am getting a new error, after no apparent updates from me or the client. The error only appears on pages with this one particular field. "DateInterval::createFromDateString(): Unknown or bad ...
1
vote
0answers
36 views

Archiving by month and year - timezone could not be found error

Following the answer in this thread -Linking and showing archive by month by P&T has worked fine for previous sites but now I'm getting the following error. I've checked I have a Time zone ...
1
vote
1answer
581 views

Date filtering returning wrong results - timezone issue?

I'm running into an issue where incorrect results are being returned when filtering Craft Commerce orders by date in a template. Can anyone help? I cannot figure out what is going on. FACTS: Craft ...
3
votes
1answer
247 views

Pull DateTime field using alternate timezone?

I have a question regarding populating models, in that I have a DateTime field in my model that I'm pulling / populating from the database. The DateTime value does not include the timezone it was set ...
2
votes
0answers
72 views

Timezone drama for events calendar

Working on site where there is events calendar of conferences and webinars. Users are (literally) all over the world. Trying to figure out how I am going to handle time zones. Factors: - Fields I am ...
1
vote
1answer
65 views

iCal feed import - Timezone query

Has anyone got any experience working with iCal feeds - I have written a plugin utilising the CalFileParser library but the UK clock changes have thrown all the items out, so eg an all day event is ...
1
vote
1answer
323 views

How can I get the server's timezone in a Craft plugin?

I'm setting up cron jobs from my plugin and I need to format the date in the server's time zone. It looks like Craft is overriding the timezone set in php.ini because PHP's date_default_timezone_get() ...
3
votes
2answers
316 views

Using user-selectable timezones to show localized post dates

In my user profiles, I have a text field where the user's timezone is set, in the standard America/New_York format. Craft's timezone is set to New York, and the server's timezone is set to UTC. I'm ...
1
vote
0answers
77 views

forms.timeField not respecting time zone

I have a plugin that uses a datetime variable to record a class start time. When I save the training record the time is changed from local MDT to GMT into the database, and when displayed again it is ...
3
votes
2answers
3k views

Get current date / time in specific timezone?

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?
3
votes
1answer
560 views

What does the Timezone in Settings -> General represent?

Should it be set to the timezone of the server Craft is installed on, or the timezone of the current user, or something else? I can find no documentation about these settings anywhere.
1
vote
1answer
143 views

expiryDate in craft_templatecaches

I've found this in the documenation: Dates and times are both formatted for the user’s preferred locale. They are displayed in the site’s timezone, however they get stored in UTC like all other ...
0
votes
1answer
293 views

Timezone in Store Hours Plugin [closed]

I am located in Austria using Pixel & Tonic's Store Hours Plugin. The Timezone in Craft's settings is set to UTC+1 (CET) - Europe/Vienna. When I type in that it's opened from 3 - 6pm it outputs ...
3
votes
1answer
268 views

Do I need to change the date.timezone in php.ini?

If I set my timezone in server and in Craft general settings, do I still need to change it in php.ini? And how does Craft handle timezone in those three places?
2
votes
1answer
1k views

Output DateTime in that timezone related to the current locale?

Is there a way to loop through a day in 15-minute intervals, with the output of said intervals being localizable? This (cringe-worthy) snippet should help explain what I'm trying to accomplish: <...