Results 1 to 18 of 18

Thread: Resolved: Setting my start date with the time at 00:00:00

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    259

    Resolved: Setting my start date with the time at 00:00:00

    I am trying to get my start date set at the first day of the week and at 0 hours.
    vb Code:
    1. Select Case Now.DayOfWeek
    2.             Case DayOfWeek.Sunday : dtStart = DateTime.Now.AddDays(-0)
    3.             Case DayOfWeek.Monday : dtStart = DateTime.Now.AddDays(-1)
    4.             Case DayOfWeek.Tuesday : dtStart = DateTime.Now.AddDays(-2)
    5.             Case DayOfWeek.Wednesday : dtStart = DateTime.Now.AddDays(-3)
    6.             Case DayOfWeek.Thursday : dtStart = DateTime.Now.AddDays(-4)
    7.             Case DayOfWeek.Friday : dtStart = DateTime.Now.AddDays(-5)
    8.             Case DayOfWeek.Saturday : dtStart = DateTime.Now.AddDays(-6)
    9.         End Select

    Right now it is setting the date minus 5 days and using the current time (8/12/2007 8:50:14 PM) because I am using DateTime.Now. How can I set it so that it will come up as 8/12/2007 12:00:00 AM

    By the way I know there has to be a more elegent way to achieve what I am trying to accomplish but so far I have come up empty.
    Last edited by FastEddie; Aug 17th, 2007 at 10:01 PM. Reason: Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width