Last post Jul 11, 2018 07:05 AM by Brando ZWZ
Jul 10, 2018 09:13 AM|ros.work88|LINK
I have used DateTime.Now in my asp.net program but the system keeps returning me the date of 20180701. I have checked the server date and time format and is correctly reflecting as 07/10/2018 and Region and Language:English(United States),Date format:M/d/yyyy.
Why is this so ? Will using DateTime.UtcNow has the same issue?
Jul 10, 2018 09:25 AM|vahid bakkhi|LINK
it possible you have set a format for the date below like :
please, First check it
Jul 10, 2018 10:00 AM|ros.work88|LINK
I did not set the format for the date. I am using DateTime.Now. I have migrated the same codes to the Testing and Production environment. The testing environment is giving me the correct date as 20180710 but not the Production. I have checked that the
server 's date/time format is correct too.
Jul 10, 2018 10:09 AM|vahid bakkhi|LINK
it depended to your code, please more describe for solve it, out your code here
Jul 11, 2018 07:05 AM|Brando ZWZ|LINK
As far as I know, the datetime.now is set to current date and time on this computer.
Its value is your computer's system time.
I suggest you could firstly modify the date and time on the computer from control panel's date, then I suggest you could try to get the datetime.now again.
This will make the datetime.now's value changed.