Bug 31590 - DateTime.UTCNow (or DateTime.Now.ToUniversalTime()) does not report correctly on XAP
Summary: DateTime.UTCNow (or DateTime.Now.ToUniversalTime()) does not report correctly...
Status: RESOLVED DUPLICATE of bug 30135
Alias: None
Product: Xamarin Android Player
Classification: Xamarin
Component: Player ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-07-02 14:56 UTC by Jon Goldberger [MSFT]
Modified: 2015-07-31 08:32 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Project (32.25 KB, application/zip)
2015-07-02 14:56 UTC, Jon Goldberger [MSFT]
Details
XAP Logs (99.82 KB, application/zip)
2015-07-02 14:56 UTC, Jon Goldberger [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 30135

Description Jon Goldberger [MSFT] 2015-07-02 14:56:06 UTC
Created attachment 11828 [details]
Test Project

## Description

This is a public version of bug #30135 which is set to private.

When reading the results of System.DateTime.UTCNow the value is equal to my
local timezone (HDT) instead of UTC. This does not occur on a device or with the Genymotion or Google Emulators.

## Steps to reproduce

1. Open the attached test project and run on a Xamarin Android Player simulator. (Tested Nexus 4 and 5, KitKat and Lollipop)

Expected result: Time value shown in the top two text views will be the same as the UTC time shown in the WebView.

Actual result: Local time value is shown in the top two text views, not UTC time. 


## Environment:

=== Xamarin Studio ===

Version 5.9.4 (build 5)
Installation UUID: 2dc9022f-f9a8-424f-8284-bf224cbbfde0
Runtime:
	Mono 4.0.2 ((detached/c99aa0c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400020005

=== Xamarin.Android ===

Version: 5.1.4.16 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.4 (7720)
Build 6E35b

=== Xamarin.iOS ===

Version: 8.10.3.2 (Business Edition)
Hash: 8b265d6
Branch: master
Build date: 2015-06-30 15:19:13-0400

=== Xamarin.Mac ===

Version: 2.0.2.35 (Business Edition)

=== Build Information ===

Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 16:52:06-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8

=== Operating System ===

Mac OS X 10.10.4
Darwin Jons-iMac.local 14.4.0 Darwin Kernel Version 14.4.0
    Thu May 28 11:35:04 PDT 2015
    root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64
Comment 1 Jon Goldberger [MSFT] 2015-07-02 14:56:38 UTC
Created attachment 11829 [details]
XAP Logs
Comment 3 jacob 2015-07-26 01:35:32 UTC
DateTime.UtcNow returns the local time (EST) under the windows 8.1 x64 version of the Xamarin Android Player (Build 0.4.4) as well. Verfied with the Nexus 5 emulator using KitKat (Android 4.4.2 - API 19).
Comment 4 Will Schaller 2015-07-31 03:43:48 UTC
This is a duplicate of 30135

*** This bug has been marked as a duplicate of bug 30135 ***
Comment 5 ppatarinski@paylocity.com 2015-07-31 08:32:55 UTC
Will I do not have access to bug 30135. Was the bug resolved or is there a workaround?