Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datetime.now.date returns wrong date
Message
From
23/03/2014 04:05:18
 
 
To
22/03/2014 21:01:38
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01597132
Message ID:
01597135
Views:
56
>This app has been running for several years on Win 7 machines with no problems.
>On a new Win 8 machine DateTime.Now.Date returns 2014-03-21:23:00 when it should return 2014-03-22.
>The time on the machine is OK and the time zone is correct.
>It consistently places the date one hour before midnight on the prior day.
>Code works fine on other Win 8 machines.
>Any suggestions?

You've shown two different formats (neither of which include seconds). How are you viewing these values and what *exactly* are you seeing ?
Also they look more like SQL datetime values than .NET (unless you're using something like DateTime.Now.Date.ToString("u",new CultureInfo("en-US"));)

If they are .Net then what is currentculture and what do DateTime.Today, DateTimeUtcNow.Date and DateTime.Now.Kind show ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform