I am going to migrating a system to Windows Azure. And it will used UTC time for all existing function. Is there any way to set the time zone globally? Or I need to change all the code which display the time? My application will mainly serve in a specified timezone.
I have try apply the culture and uiculture on web.config. And it does not work.
Thanks.
As per the Windows Azure Team Blog - all the timing calculations/display etc have been moved to UTC.. https://azure.microsoft.com/en-us/blog/moving-to-coordinated-universal-time-utc/
I feel you would need to change the code which display the time as well which saves the time as well..
Related
I am using Angularjs v1.7.5 and Angular-Gantt v2.0.0
In addition, I am using ASP.Net Boilerplate v3.2.4 as a backend. multiple tenancy is disabled.
When setting timezone in Setting as (e.g: UTC+02:00 Damascus) or any other timezone other than Default UTC (Etc/UTC) the page is not responding and browser is freezing.
I've already tries using MomentJs instead of default javascript date and it's not working.
so my question here is whether anyone has experienced this problem and what is the solution for it.
Workaround:
Disabling multiple timezone support in Asp.Net Boilterplate by setting local timezone
in Global.asax as next :
Clock.Provider = ClockProviders.Local;
has solved the problem.
But I'm looking for a better way to solve the problem while keeping multiple timezone support.
Thank you guys in advanced.
My Windows Phone app uses location tracking, and I am stamping the positions I use, with the system date and time.
This has worked well, but now there was a situation with a user, who had his date/time setup horribly wrong on his phone, meaning that the timestamps on his positions were all wrong.
So, I was looking into the Timestamp property on the Geocoordinate instead, but my question is: Is that timestamp really from the GPS unit, or is it just the system (device) date/time of when the position was obtained?
The documentation on MSDN says it is:
The system time at which the location was determined.
If that is the case I really don't see much use for it, but has anyone tested or have experience with this?
I have always interpreted this as the Systemtime but your question made me curios. So I tested this by experiment, switching off the set-time automatically and changing the the time somewhat will indeed change the timestamp of the Geocoordinate. While I have not found a good source to collaborate this my experiment makes me believe that your assessment is correct.
A way to go around this problem for your app could be to get the time from an online time service such as timezonedb api ?
In my MVC application I am selecting the company & doing my operations based on that.
as you can see in the Image below::
Here the problem is with the Timezone based on the company I have selected. Because I have to Insert the Datetime for the current Timezone.
We know in C# there are Inbuild properties like ::
DateTime.Now
DateTime.UtcNow
TimeZone.CurrentTimeZone
I just want the time based on companies selected from the above Dropdown in C#.
Please Help me on this,
Thanks in Advance.
You can get it by using Date.getTimezoneOffset(). This links might helps you.
http://aspdotnet-naresh.blogspot.in/2013/05/aspnet-how-to-convert-to-different-time.html
get client machine timezone in asp.net mvc
http://www.w3schools.com/jsref/jsref_getTimezoneOffset.asp
Get the default timezone for a country (via CultureInfo)
To start, I recommend http://nodatime.org, because they have some mapping functions from the more common Olson-format to the windows time zone format. Read more about this: Olson Time Zone Id to Windows Standard Format using Noda Time
To solve your problem, there are multiple options:
Save the name of the timezon in Olson format in your database.
Save the geolocation in your database. You can use the shape file with timezones to select the right timezone based on geolocations. http://efele.net/maps/tz/world/. There is also library to read this file: http://www.easygisdotnet.com/api/
Calendar Class
.NET Framework 2.0 Other Versions
Displays a single-month calendar that allows the user to select dates and move to the next or previous month.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Questions
By default which calender type does it use? (english,german,western,eastern etc i guess, or the servers bios settings time/date?)
Is it fully dependent on the systems clock settings? (well no explanation here yes or no? if yes then answer point 3)
Any way to provide web synchronization? (so that dependency on server time and date is removed)
1.not 100% what you mean, you can return it to string or datetime
2. dependent on the server time
3.not sure what you mean, you can store a date in a database and use that to set what date your calendar starts
I have a website that displays the current date using the code Datetime.Now. From what I understand, Datetime.Now is supposed to display the current time as it would appear in the viewer's current locale.
At the moment, when I test on localhost, the website is correctly determining my location (en-nz) and displaying the right date. However, when I run the site live, I'm getting a different date all together.
So how does a system determine a viewer's locale and why is there a difference between how my site is displaying Datetime.Now locally and live?
DateTime.Now has the time of the server, but not the time of the client. If you want to detect the time of the client you need to use Javascript, either by detecting the time with it or calculating it using the time zones.
In your localhost works fine, since the server and the client are in the same PC/Time Zone
Hope it helps!
No, DateTime.Now will retrieve the current time in the local time zone of the machine it's running on. In other words, the web server in your case, assuming you're writing a web app (you haven't made it clear).
If you want to display it in the local time zone of a browser, you may well be best to send down DateTime.UtcNow and write some JavaScript to convert that to the local time... or just let JavaScript work out the current time on the user's system.
As far as I know, there's no way of getting the time zone from JavaScript accurately. You can get the current offset from UTC, but that's not the same as the time zone itself. (Offsets change due to things like DST; knowing the current offset doesn't tell you when DST will kick in.)
Maybe machines have different time settings? If development and live servers are in different locations, that's quite possible. As other answers say, DateTime.Now gets server time, not client time.