emmim44 — 2012-06-14T02:41:48-04:00 — #1
I am trying to check if current datetime is between current date plus 06:00:00 and 20:00:00 (in turkish culture)
I want date to be populated as "dd.mm.yyyy hh:mm:ss"... How would I do this in vb.net?
Dim sDate as String = TodayIs.ToShortDateString + " 06:00:00"
Dim eDate as String = TodayIs.ToShortDateString + " 20:00:00"
if time >= sDate and time <= eDate then
jason__c — 2012-06-14T07:45:32-04:00 — #2
Ever thought of changing the culture before formatting the Date?
wwb_99 — 2012-06-14T18:19:59-04:00 — #3
Don't go out to strings. If you are looking to see if something is between 6am and 8pm then:
Dim today as DateTime.Now
Dim sixAm as today.Date.AddHours(6)
Dim eightPm as today.Date.AddHours(20)
Then you can check if something is between those two dates. Strings are not your friends.
emmim44 — 2012-06-15T05:12:52-04:00 — #4
jason__c — 2012-06-15T07:11:32-04:00 — #5
Can you show me the code for the culture change you made?