Results 1 to 13 of 13
  1. #1
    Shark23's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Kansas
    Posts
    424
    Reputation
    10
    Thanks
    55
    My Mood
    Cool

    Question [Solved]Now Date/Now Day

    Right now in VB I'm using a "DateInterval.Month" procedure and a "DateInterval.Day" procedure. Right now this is saying that it is February 4th. Is there a way to change that? I need the current date.
    Last edited by Shark23; 03-16-2010 at 11:11 PM.

  2. #2
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    If you trying to find the date just do Today.
    Ex: Label1.text = today

  3. #3
    Shark23's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Kansas
    Posts
    424
    Reputation
    10
    Thanks
    55
    My Mood
    Cool
    I need to check whether textbox1 = current month and textbox2 = current day.

  4. #4
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    if u want the time with the date it's:
    Code:
    now
    I KNOW AMAZING RIGHT?


    -----------------------------------------------

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



  5. #5
    Shark23's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Kansas
    Posts
    424
    Reputation
    10
    Thanks
    55
    My Mood
    Cool
    Uhhhh, no I don't need the time. Like I said before, I need to check whether or not TextBox1.Text = Current Month and TextBox2.Text = Current Day.

  6. #6
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81


    -----------------------------------------------

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



  7. #7
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    First

    Namespace
    [php]
    Imports System.Globalization
    Imports System.Threading
    [/php]

    Form Load Event or whatever triggers the event
    I used a button

    [php]
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim Info As CultureInfo = Thread.CurrentThread.CurrentCulture
    Dim Curmonth As String = Info.DateTimeFormat.GetMonthName(DateTime.Now.Mont h)
    Dim Curday As String = Info.DateTimeFormat.GetDayName(DateTime.Now.Day)
    TextBox1.Text = Curmonth
    TextBox2.Text = Curday
    End sub
    [/php]

    My code will get the current month and current day and display them into separate text boxes.

    Have fun






     


     


     



    The Most complete application MPGH will ever offer - 68%




  8. #8
    Shark23's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Kansas
    Posts
    424
    Reputation
    10
    Thanks
    55
    My Mood
    Cool
    Still not working. Alright, so this program has 3 textboxes and a button. Textbox1 is for the month. Textbox2 is for the day. Textbox3 is for your name. I'm trying to input the month number(1-12) in textbox1 and the day number(1-31) in textbox2. If textbox1's text is the current month and textbox2's text is the current day, the messagebox displays a message. Right now I have:

    Code:
            Dim Info As CultureInfo = Thread.CurrentThread.CurrentCulture
            Dim Curmonth As String = Info.DateTimeFormat.GetMonthName(DateTime.Now.Month)
            Dim Curday As String = Info.DateTimeFormat.GetDayName(DateTime.Now.Day)
            Dim strMonth As String
            Dim strDay As String
            Dim strName As String
    
            strName = txtName.Text
            strMonth = txtMonth.Text
            strDay = txtDay.Text
    
            If Curmonth = strMonth And Curday = strDay Then
                'Current date equals entered date
                MessageBox.Show("'Message here'")
            Else
                'Current date does not equal entered date
                MessageBox.Show("'Message here'")
            End If
        End Sub

  9. #9
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Slight error in my code

    I apologize

    [php]
    Dim Info As CultureInfo = Thread.CurrentThread.CurrentCulture
    Dim Curmonth As String = Info.DateTimeFormat.GetMonthName(DateTime.Now.Mont h)
    Dim Curday As String = Info.DateTimeFormat.GetDayName(DateTime.Today.DayO fWeek)
    TextBox1.Text = Curmonth
    TextBox2.Text = Curday
    [/php]



    This should work

    Your code should be

    [php]
    Dim Info As CultureInfo = Thread.CurrentThread.CurrentCulture
    Dim Curmonth As String = Info.DateTimeFormat.GetMonthName(DateTime.Now.Mont h)
    Dim Curday As String = Info.DateTimeFormat.GetDayName(DateTime.Today.DayO fWeek)
    Dim strMonth As String
    Dim strDay As String
    Dim strName As String

    strName = TextBox1.Text
    strMonth = TextBox2.Text
    strDay = TextBox3.Text

    If Curmonth = strMonth And Curday = strDay Then
    'Current date equals entered date
    MessageBox.Show("'Message here'")
    Else
    'Current date does not equal entered date
    MessageBox.Show("'Message here'")
    End If
    End Sub
    [/php]



    Last edited by NextGen1; 03-16-2010 at 09:45 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  10. The Following User Says Thank You to NextGen1 For This Useful Post:

    Shark23 (03-16-2010)

  11. #10
    Shark23's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Kansas
    Posts
    424
    Reputation
    10
    Thanks
    55
    My Mood
    Cool
    Quote Originally Posted by NextGen1 View Post
    Slight error in my code

    I apologize

    [php]
    Dim Info As CultureInfo = Thread.CurrentThread.CurrentCulture
    Dim Curmonth As String = Info.DateTimeFormat.GetMonthName(DateTime.Now.Mont h)
    Dim Curday As String = Info.DateTimeFormat.GetDayName(DateTime.Today.DayO fWeek)
    TextBox1.Text = Curmonth
    TextBox2.Text = Curday
    [/php]



    This should work

    Your code should be

    [php]
    Dim Info As CultureInfo = Thread.CurrentThread.CurrentCulture
    Dim Curmonth As String = Info.DateTimeFormat.GetMonthName(DateTime.Now.Mont h)
    Dim Curday As String = Info.DateTimeFormat.GetDayName(DateTime.Today.DayO fWeek)
    Dim strMonth As String
    Dim strDay As String
    Dim strName As String

    strName = TextBox1.Text
    strMonth = TextBox2.Text
    strDay = TextBox3.Text

    If Curmonth = strMonth And Curday = strDay Then
    'Current date equals entered date
    MessageBox.Show("'Message here'")
    Else
    'Current date does not equal entered date
    MessageBox.Show("'Message here'")
    End If
    End Sub
    [/php]



    Almost perfect. I need the day of the month(1-31) not the day of the week(Sunday-Saturday) but thanks a lot! This was really frustrating. Thanks!

    EDIT: Got it working perfectly now!
    Last edited by Shark23; 03-16-2010 at 11:07 PM.

  12. The Following User Says Thank You to Shark23 For This Useful Post:

    NextGen1 (03-17-2010)

  13. #11
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Good to hear it was resolved


     


     


     



    The Most complete application MPGH will ever offer - 68%




  14. #12
    Sixx93's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    673
    Reputation
    21
    Thanks
    250
    My Mood
    Cool
    use the datatimepicker utility

  15. #13
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by Sixx93 View Post
    use the datatimepicker utility
    Issue already resolved, and using components in a situation where it is not needed is bad coding tactics


     


     


     



    The Most complete application MPGH will ever offer - 68%




Similar Threads

  1. Server Busy HELP NOW PLEASE?
    By SharcBate1 in forum Combat Arms Help
    Replies: 3
    Last Post: 03-22-2010, 01:55 AM
  2. Need help now!
    By RUNmyHACK in forum Combat Arms EU Discussions
    Replies: 19
    Last Post: 03-02-2010, 06:21 AM
  3. Okay I need help now lol
    By falzarex in forum C++/C Programming
    Replies: 6
    Last Post: 12-18-2009, 03:03 AM
  4. Help now
    By Melikepie in forum Combat Arms Help
    Replies: 0
    Last Post: 09-11-2009, 11:45 PM