c# - How to change time in datetime? -


How do I change time alone in the dateTime variable?

  date time = a few days' time;  

I need a change in time only in s .

You can not change the datetime value - it is irreversible, however, you have to keep the variable can change. To change only time, the easiest way to do this is to create a timepane with relevant time, and use the DateTime.Date property:

  DateTime s = ...; Timespain TS = new timespan (10, 30, 0); S = s.Date + ts;  

s will now be a single date, but at 10.30

Note that date of time ignore daylight saving time saving, representing "inexperienced" Gregorian times in both directions (see comments section) only The exception is . Now and . Today : They retrieve the current system time, which reflects these events as they are.

It's like something that inspired me to start the project, which is now ready to produce. Its ZonedDateTime type is "aware".


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -