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. How to display Day

How to display Day

Scheduled Pinned Locked Moved ASP.NET
csharphelptutorial
13 Posts 3 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.
  • K Offline
    K Offline
    Khan Bangash
    wrote on last edited by
    #1

    HI All, I want to display day like Tuesday , Friday , Sunday etc etc. I use the following response.write(date.now.day)...........But instead of day date is displayed......Please help me..... I m using VB.NET.......... Thanks in advance..........

    E S 2 Replies Last reply
    0
    • K Khan Bangash

      HI All, I want to display day like Tuesday , Friday , Sunday etc etc. I use the following response.write(date.now.day)...........But instead of day date is displayed......Please help me..... I m using VB.NET.......... Thanks in advance..........

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      try putting it in a label as follows: Label1.Text = DateTime.Now.Day.ToString(); maybe this instead: DateTime dtday = DateTime.Now; dtday.DayOfWeek

      K 1 Reply Last reply
      0
      • E eyeseetee

        try putting it in a label as follows: Label1.Text = DateTime.Now.Day.ToString(); maybe this instead: DateTime dtday = DateTime.Now; dtday.DayOfWeek

        K Offline
        K Offline
        Khan Bangash
        wrote on last edited by
        #3

        I have tried that too..........But failed..........I dont know whts wrong with that......

        S 1 Reply Last reply
        0
        • K Khan Bangash

          HI All, I want to display day like Tuesday , Friday , Sunday etc etc. I use the following response.write(date.now.day)...........But instead of day date is displayed......Please help me..... I m using VB.NET.......... Thanks in advance..........

          S Offline
          S Offline
          Sandeep Akhare
          wrote on last edited by
          #4

          check this DateTime.Today.DayOfWeek.ToString() Will return day of the week

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          E 1 Reply Last reply
          0
          • S Sandeep Akhare

            check this DateTime.Today.DayOfWeek.ToString() Will return day of the week

            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

            E Offline
            E Offline
            eyeseetee
            wrote on last edited by
            #5

            dam you just beat me to it! see edited posted above

            K S 2 Replies Last reply
            0
            • K Khan Bangash

              I have tried that too..........But failed..........I dont know whts wrong with that......

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #6

              How it got failed could you be more specific ? Why are you trying Response.Write function ? Let me know what are you trying to do ?

              Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

              1 Reply Last reply
              0
              • E eyeseetee

                dam you just beat me to it! see edited posted above

                K Offline
                K Offline
                Khan Bangash
                wrote on last edited by
                #7

                Actually I m sending Email.....But first I store all info in string "emailBody", then at last I send Email and assing that variable to Emailbody........

                E 1 Reply Last reply
                0
                • K Khan Bangash

                  Actually I m sending Email.....But first I store all info in string "emailBody", then at last I send Email and assing that variable to Emailbody........

                  E Offline
                  E Offline
                  eyeseetee
                  wrote on last edited by
                  #8

                  Can you post some sample code so we can try and replicate the error

                  1 Reply Last reply
                  0
                  • E eyeseetee

                    dam you just beat me to it! see edited posted above

                    S Offline
                    S Offline
                    Sandeep Akhare
                    wrote on last edited by
                    #9

                    OOPS went for lunch When i clicked reply to this question,that time No replies were there. At my end the internet is very slow,so in mean time you replied. It always happened if you didn't refresh CP page, CP should automatically get refresh after certain time interval to avoid similar replies. What you say ?

                    Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                    K 1 Reply Last reply
                    0
                    • S Sandeep Akhare

                      OOPS went for lunch When i clicked reply to this question,that time No replies were there. At my end the internet is very slow,so in mean time you replied. It always happened if you didn't refresh CP page, CP should automatically get refresh after certain time interval to avoid similar replies. What you say ?

                      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                      K Offline
                      K Offline
                      Khan Bangash
                      wrote on last edited by
                      #10

                      dim emailbody as string. emailbody = "some text" emailbody &= date.now.day Dim mailObj As New Mail.MailMessage mailObj.To = "myID@domain.com" mailObj.From = "admin@domain.com" mailObj.Subject = "Testing" mailObj.Body = emailBody mailObj.BodyFormat = MailFormat.Html SmtpMail.SmtpServer = "127.0.0.1" SmtpMail.Send(mailObj)

                      S E 2 Replies Last reply
                      0
                      • K Khan Bangash

                        dim emailbody as string. emailbody = "some text" emailbody &= date.now.day Dim mailObj As New Mail.MailMessage mailObj.To = "myID@domain.com" mailObj.From = "admin@domain.com" mailObj.Subject = "Testing" mailObj.Body = emailBody mailObj.BodyFormat = MailFormat.Html SmtpMail.SmtpServer = "127.0.0.1" SmtpMail.Send(mailObj)

                        S Offline
                        S Offline
                        Sandeep Akhare
                        wrote on last edited by
                        #11

                        try this use DateTime.Today.DayOfWeek.ToString(); instead what you have been using. Suggesting to use StringBuilder instead of string Don't know about other things which are correct or not Again if get any problem why the mail is not getting send then please have a look in google dim emailbody as string. emailbody = "some text" emailbody &= DateTime.Today.DayOfWeek.ToString(); Dim mailObj As New Mail.MailMessage mailObj.To = "myID@domain.com" mailObj.From = "admin@domain.com" mailObj.Subject = "Testing" mailObj.Body = emailBody mailObj.BodyFormat = MailFormat.Html SmtpMail.SmtpServer = "127.0.0.1" SmtpMail.Send(mailObj)

                        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                        K 1 Reply Last reply
                        0
                        • K Khan Bangash

                          dim emailbody as string. emailbody = "some text" emailbody &= date.now.day Dim mailObj As New Mail.MailMessage mailObj.To = "myID@domain.com" mailObj.From = "admin@domain.com" mailObj.Subject = "Testing" mailObj.Body = emailBody mailObj.BodyFormat = MailFormat.Html SmtpMail.SmtpServer = "127.0.0.1" SmtpMail.Send(mailObj)

                          E Offline
                          E Offline
                          eyeseetee
                          wrote on last edited by
                          #12

                          Why post the above code with

                          coolmindd wrote:

                          emailbody &= date.now.day

                          we had already given you an example of how to get it to work with the new code

                          1 Reply Last reply
                          0
                          • S Sandeep Akhare

                            try this use DateTime.Today.DayOfWeek.ToString(); instead what you have been using. Suggesting to use StringBuilder instead of string Don't know about other things which are correct or not Again if get any problem why the mail is not getting send then please have a look in google dim emailbody as string. emailbody = "some text" emailbody &= DateTime.Today.DayOfWeek.ToString(); Dim mailObj As New Mail.MailMessage mailObj.To = "myID@domain.com" mailObj.From = "admin@domain.com" mailObj.Subject = "Testing" mailObj.Body = emailBody mailObj.BodyFormat = MailFormat.Html SmtpMail.SmtpServer = "127.0.0.1" SmtpMail.Send(mailObj)

                            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                            K Offline
                            K Offline
                            Khan Bangash
                            wrote on last edited by
                            #13

                            Thanks Sandeep Brother....... My problem solved with the following.......... DateTime.Today.DayOfWeek.ToString(); I realy appriciate u people........ Thanks for helping.....

                            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