.NET Convert.ChangeType from string to DateTime doesn't respect timezone? -


i'm guessing i'm missing obvious, here goes...

it december in mountain time zone, meaning mst , -07:00. in following code, .net returns datetime time portion of 1:34 pm, correlates -06:00. doing wrong?

private void button1_click( object sender, eventargs e )     {     datetime test = new datetime();     test = (datetime)system.convert.changetype( "1988-08-08t12:34:00.000-07:00", type.gettype( "system.datetime" ), cultureinfo.currentculture );     messagebox.show( test.tostring() ); // shows "8/8/1988 1:34:00 pm"     } 

i should mention i've pulled concept (using convert.changetype) guts of json.net, encountered problem. can't (and don't want to) change code use different conversion method.

use offset aware struct datetimeoffset instead of datetime.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -