Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Check the Given date is sunday or not...,

Check the Given date is sunday or not...,

Scheduled Pinned Locked Moved ASP.NET
tutorialhelpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 3879881
    wrote on last edited by
    #1

    Hi i want to check the given date is sunday or not like..., Suppose if its sunday it want to execute some conditions otherwise it want to do some other condition..., how to do that one? Plz help me...., example: i have 4 textbox each have some values..., If the given date will be sunday it want to add textbox 2 & 3 and store it in textbox 1 else,if its weekday then it want to add textbox 2 & 4 and store the value in textbox 1 how to do that plz any one help me..., -- modified at 4:30 Wednesday 30th May, 2007

    Magi

    L V P 3 Replies Last reply
    0
    • M Member 3879881

      Hi i want to check the given date is sunday or not like..., Suppose if its sunday it want to execute some conditions otherwise it want to do some other condition..., how to do that one? Plz help me...., example: i have 4 textbox each have some values..., If the given date will be sunday it want to add textbox 2 & 3 and store it in textbox 1 else,if its weekday then it want to add textbox 2 & 4 and store the value in textbox 1 how to do that plz any one help me..., -- modified at 4:30 Wednesday 30th May, 2007

      Magi

      L Offline
      L Offline
      Luka Grabarevic
      wrote on last edited by
      #2

      Hi, you could try. if(DayOfWeek.Sunday.CompareTo(YourDate.DayOfWeek) == 0) { ... } the CompareTo function returns either "-1" = false or "0" = true. hope this helps greetings pdluke

      1 Reply Last reply
      0
      • M Member 3879881

        Hi i want to check the given date is sunday or not like..., Suppose if its sunday it want to execute some conditions otherwise it want to do some other condition..., how to do that one? Plz help me...., example: i have 4 textbox each have some values..., If the given date will be sunday it want to add textbox 2 & 3 and store it in textbox 1 else,if its weekday then it want to add textbox 2 & 4 and store the value in textbox 1 how to do that plz any one help me..., -- modified at 4:30 Wednesday 30th May, 2007

        Magi

        V Offline
        V Offline
        Venk259
        wrote on last edited by
        #3

        VB Code -.net 2.0 ------- Dim dateobj As Date dateobj = Now If( dateobj.DayOfWeek = DayOfWeek.Sunday) Then textbox1.Text=CInt(textbox2.Text) + CInt(textbox3.Text) Else textbox1.Text=CInt(textbox2.Text) + CInt(textbox4.Text) End If C# Code-.net 2.0 ------- DateTime dateobj; dateobj = DateTime.Now; if( dateobj.DayOfWeek == DayOfWeek.Sunday) { textbox1.Text=Convert.ToInt32(textbox2.Text) + Convert.ToInt32(textbox3.Text) } else { textbox1.Text=Convert.ToInt32(textbox2.Text) + Convert.ToInt32(textbox4.Text) }

        1 Reply Last reply
        0
        • M Member 3879881

          Hi i want to check the given date is sunday or not like..., Suppose if its sunday it want to execute some conditions otherwise it want to do some other condition..., how to do that one? Plz help me...., example: i have 4 textbox each have some values..., If the given date will be sunday it want to add textbox 2 & 3 and store it in textbox 1 else,if its weekday then it want to add textbox 2 & 4 and store the value in textbox 1 how to do that plz any one help me..., -- modified at 4:30 Wednesday 30th May, 2007

          Magi

          P Offline
          P Offline
          Prakash_Mishra
          wrote on last edited by
          #4

          hi there is a property called IsWeekend property I got some information from net i wil give u the link it is http://www.ucertify.com/articles/70-305/What-is-the-IsWeekend-property.html check whether its of any use 4 u or not.

          Prakash Mishra(Banglore,India)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups