Is it possible to change all dates and times to UTC instead of local timezone in the AWS console for my account?
The timezone is UTC when using the AWS CLI, but always in my local timezone in the console. It is redundant for me to have to calculate times each time when comparing with server or colleagues times.
There is no option to change the timezone in the unified settings section.
It seems like the only way to do that is to change the browser/os' timezone.
Related
I'm building few dashboards in Apache superset. All my available timestamp fields are in UTC timezone. (for example fields are, class_start_time & class_end_time).
I want that in the timezone the dashboard is opened all the timestamp fields will be automatically converted.
For example, I'm opening dashboard in Norway , so the UTC data should be converted to CET timezone of Norway.
I have tried to add some value here in Hours offset but its not working.
Can you please guide how we can achieve this.?
Just for reference :
In Kibana dashboards (ELK stack) have feature to automatically convert the timezone into which it is being opened. So I need same thing in Superset.
Normally you would be able to set this with environment variables when you start the program or container. In Apache Superset, this is not possible. There is an ongoing discussion on Github about this issue. One GitHub user posts the problem and workaround, which is far from workable:
Daylight savings causes issues where users have to update datasource
timezone offset for each datasource twice per year.
So the only thing you can do is update the hours offset twice a year. To make matters even worse, if you use Postgresql, this may not even be possible due to a bug as described here.
When I Insert timestamp into Postgres table in EST (2019-02-21 05:37:46) and in Postgresql table is stores in IST (2019-02-21 16:07:46). I want time to be stored only in EST. Can anyone help me to fix this issue?
In postgres, you can change the default format mask for datetimes using the set n postgres, you can change the default format mask for datetimes using the set datestyle
for more details follow this link
also refer this link
To my knowledge, there is no setting in PostgreSQL that would trim seconds from timestamp literals by default
In general you should handle all datetimes in UTC, because these are absolute timestamps that are always correct. Even if you are only going to have users in the EST time zone use your website, the EST time zone has daylight saving time (DST) in the summer, so you could get buggy behaviour when the time jumps (especially since there is an overlap of one hour when the clock goes back). This means:
Your code should use UTC timestamps to make calculations and pass around
Your database should store UTC datetime (which PostgreSQL does anyway).
You should only transform to a local time zone when presenting the data to the user. This is default behaviour in Django:
USE_TZ = True by default
TIME_ZONE = "America/New_York" to set default time zone, which will take into account DST
So when you're saving a time-aware datetime to the database (in EST say), the database stores it as UTC. When you fetch and display it, Django will show it in the current time zone of the user (EST in your case). When you query the database directly using a tool, PostgreSQL gives back the UTC, correct datetime, but your shell or tool might display it in the local time zone. You can format your query to use a different time zone using the links posted by #c.grey in the other answer.
Read up on the details here
I am writing a site to be served internationally across multiple timezones.
In the settings.py:
TIME_ZONE = 'UTC'
USE_TZ = True
I am wondering if someone from NZ puts in a datetime via models.DateTimeField, does it automatically picks up the current timezone and convert to UTC without any extra code?
I am a bit confused on this paragraph:
The current time zone is the equivalent of the current locale for
translations. However, there’s no equivalent of the Accept-Language
HTTP header that Django could use to determine the user’s time zone
automatically. Instead, Django provides time zone selection functions.
Use them to build the time zone selection logic that makes sense for
you.
So do I have to override the save method to add the get_current_timezone()?
The key sentence there is: "However, there’s no equivalent of the Accept-Language HTTP header that Django could use to determine the user’s time zone automatically."
So there's no way for Django to reliably figure out your NZ user's time zone. It's not going to give you the user's time zone - you have to tell it! Specifically, until you explicitly activate() a time zone, the current time zone is just UTC as you defined in your TIME_ZONE setting.
When it comes to user input, the documentation says: "Django interprets datetimes entered in forms in the current time zone and returns aware datetime objects." So, if you've activated the appropriate NZ time zone then the conversion will happen as you expect. But if not, the datetime will be interpreted as being in your default UTC timezone.
How do you figure out the user's timezone? The documentation gives an example of how you can set it based on a value explicitly chosen by the user. I'm sure there are also services out there that try to guess the time zone based on the IP address. Either way, though, Django won't do it for you.
I have account on amazon cloud, and I am using Cloudwatch to monitor my website. But all the reports/charts in Cloudwatch are coming in as UTC time. I have to calculate time against my timezone (UTC+05:30, Indian Standard Time).
Is there any way to set the timezone for my reports?
They've (very) recently added a drop down that allows you to set your local timezone.
The latest version of AWS DynamoDB seems to have rearranged the UI elements. Currently you can find the timezone selector when you click on custom period selector. There are only two options. By default, it shows the chart in "UTC". The second option is "Local timezone".
I am using Facebook graph API to post on pages
What is the timezone that Facebook publish the scheduled posts in pages?
Is it the admin timezone?
Like this: 1354308243
I don't know about facebook api, but this looks like unix timestamp, which is a number of seconds since epoch and epoch is Jan 1st, 1970 UTC.
What you are dealing with is called timestamp which doesn't mess up things with timezone at all because you calculate the timestamp of your time in timezone and work with it. And whatever time it will be across different parts of the world, it will happen exactly on the specified time.
So instead of saying post it on 7PM, convert the 7PM into timestamp and wotk with that number, like post it on 1354308243. Makes sense?
I had the same problem by setting my php script to use UTC, but timestamp I used created +2 hours time in Facebook. After investigation and checking reference API I found that the user's timezone is offset from UTC
https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Dtimezone&version=v2.10
I saw that my timezone is +2 from UTC time, so I changed it in php script to adjust it. Now it is working OK.
So I assume it relies on admin timezone.