Op zoek naar de oorzaak van een tijdsprobleem (ik heb er op zich wel genoeg, daar niet van), kwam ik op deze pagina terecht:
Ik probeer te begrijpen waarom de 2 stukken code verschillend zouden zijn. Ik heb de tekst een paar keer doorgelezen, maar volgens mij zie ik iets simpels over het hoofd.Let's look at some code that doesn't work:
Visual Basic:
1 2 3 Dim d As DateTime d = DateTime.Parse("Dec 03, 2003 12:00:00 PM") 'date assignment d.ToUniversalTime()
The program above takes the value in variable d and saves it to a database, expecting the stored value to represent a UCT view of time. This example recognizes that the Parse method renders the result in local time unless some non-default culture is used as an optional argument to the Parse family of methods.
Fixing the code sample is easy:
Visual Basic:
1 2 Dim d As DateTime d = DateTime.Parse("Dec 03, 2003 12:00:00 PM").ToUniversalTime()
Wij onderbreken deze thread voor reclame:
http://kalders.be