Date Problemo - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Date Problemo

hofadommahofadomma Posts: 28Member
Hello Everyone, I need a little help in a program I'm trying to make.

A part of it is like this, and I need help on getting the date to update every time it is run according to the computers date....

example:

shell "xcopy d:hofadomma.txt d:a /e /y /d:07/09/2002"

now, The problem is..... how do I get the computers current date and fill into the date part everytime the program is run, in that exact format too! Any help is appreciated. Thanks.

Comments

  • paulj59paulj59 Posts: 420Member
    : Hello Everyone, I need a little help in a program I'm trying to make.
    :
    : A part of it is like this, and I need help on getting the date to update every time it is run according to the computers date....
    :
    : example:
    :
    : shell "xcopy d:hofadomma.txt d:a /e /y /d:07/09/2002"
    :
    : now, The problem is..... how do I get the computers current date and fill into the date part everytime the program is run, in that exact format too! Any help is appreciated. Thanks.
    :

    format$(Now(),"mm/dd/yyyy")
  • hofadommahofadomma Posts: 28Member
    : : Hello Everyone, I need a little help in a program I'm trying to make.
    : :
    : : A part of it is like this, and I need help on getting the date to update every time it is run according to the computers date....
    : :
    : : example:
    : :
    : : shell "xcopy d:hofadomma.txt d:a /e /y /d:07/09/2002"
    : :
    : : now, The problem is..... how do I get the computers current date and fill into the date part everytime the program is run, in that exact format too! Any help is appreciated. Thanks.
    : :
    :
    : format$(Now(),"mm/dd/yyyy")


    Thanks :)
    :

  • hofadommahofadomma Posts: 28Member
    : : : Hello Everyone, I need a little help in a program I'm trying to make.
    : : :
    : : : A part of it is like this, and I need help on getting the date to update every time it is run according to the computers date....
    : : :
    : : : example:
    : : :
    : : : shell "xcopy d:hofadomma.txt d:a /e /y /d:07/09/2002"
    : : :
    : : : now, The problem is..... how do I get the computers current date and fill into the date part everytime the program is run, in that exact format too! Any help is appreciated. Thanks.
    : : :
    : :
    : : format$(Now(),"mm/dd/yyyy")
    :
    :
    : Thanks :)
    : :
    : Well that helped Alot! One last thing..... anyone know how to do this? When the program is run, how do you make it invisable, just show up in the task manager, not the task bar...... the program loads on formload so there is no interface or controls, just pure work as soon as it's executed. Thank you for your future help...

  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : Well that helped Alot! One last thing..... anyone know how to do this? When the program is run, how do you make it invisable, just show up in the task manager, not the task bar...... the program loads on formload so there is no interface or controls, just pure work as soon as it's executed. Thank you for your future help...
    :

    Add a .bas module. Copy the code from Form_Load to a sub in the module named Main. Remove the form from the project. Run or compile. VB will complain about startup, select Sub Main. It should now work as you want.
    [code]
    Private Sub Main()

    'Code here

    End Sub
    [/code]
    VB doesn't make it real obvious, but no forms are required. As long as you have a form or a Sub Main, your app can execute.
  • paulj59paulj59 Posts: 420Member
    : : Well that helped Alot! One last thing..... anyone know how to do this? When the program is run, how do you make it invisable, just show up in the task manager, not the task bar...... the program loads on formload so there is no interface or controls, just pure work as soon as it's executed. Thank you for your future help...
    : :
    :
    : Add a .bas module. Copy the code from Form_Load to a sub in the module named Main. Remove the form from the project. Run or compile. VB will complain about startup, select Sub Main. It should now work as you want.
    : [code]
    : Private Sub Main()
    :
    : 'Code here
    :
    : End Sub
    : [/code]
    : VB doesn't make it real obvious, but no forms are required. As long as you have a form or a Sub Main, your app can execute.
    :

    If you need a form, because you have controls, then set the form's .Visible property=False
    If you can set the .BorderStyle property=0, it won't show in the task bar.
    In your case, Mike's suggestion is best.
  • paulj59paulj59 Posts: 420Member
    : : : Well that helped Alot! One last thing..... anyone know how to do this? When the program is run, how do you make it invisable, just show up in the task manager, not the task bar...... the program loads on formload so there is no interface or controls, just pure work as soon as it's executed. Thank you for your future help...
    : : :
    : :
    : : Add a .bas module. Copy the code from Form_Load to a sub in the module named Main. Remove the form from the project. Run or compile. VB will complain about startup, select Sub Main. It should now work as you want.
    : : [code]
    : : Private Sub Main()
    : :
    : : 'Code here
    : :
    : : End Sub
    : : [/code]
    : : VB doesn't make it real obvious, but no forms are required. As long as you have a form or a Sub Main, your app can execute.
    : :
    :
    : If you need a form, because you have controls, then set the form's .Visible property=False
    : If you can set the .BorderStyle property=0, it won't show in the task bar.
    : In your case, Mike's suggestion is best.
    :
    Or maybe its Dave's?
  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : : In your case, Mike's suggestion is best.
    : :
    : Or maybe its Dave's?
    :

    If you're talking 'bout me, it's Mike.
Sign In or Register to comment.