Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Creating a batch file that input date & time

Featured Replies

Hi

I create my logo and assign a job for each XP install I do. My job number takes the date and time of the day I am working on a piece. eg 200403242038 and this never repeats. Now how can i create a batch file that can automatically assign the date and time so that i can generate this job number

:)

  • Author

On the cmd when I type Date i get " the current date is *****" " enter new date

the same thing for time. Now I want to capture these parameters ( date and time) so that i can use the generated date and time in my answer file. is it possible

gpm

This works for Windows NT and up:

DATE /T outputs the current date

TIME /T outputs the current time

Forgot to mention that the output from DATE and TIME can be redirected to another program or to a file.

  • Author

thanks iam getting somewhere now - is it possible to craete an output file with date and time in one line, why because I want it that way to create a job # for my logo. I use a program called wintrieve to create the logo and put support info

gpm

Dim obj, strA
Set obj = CreateObject("Scripting.FileSystemObject")
Set strA = obj.CreateTextFile("datetime.txt", True)
strA.write(now())
strA.Close
Set obj = Nothing

Save that as Datetime.vbs and just run it. It will create the file in same Dir

You can change this to whatever you want "datetime.txt" like "C:\App\datetime.txt"

Windows has 2 variables for this. One is %time% and other is %date%. You can try them by typing

echo %time%

or

echo %date%

into the comamnd line. I would use it as:

copy backup.rar "%date%backup.rar"

,Mar 27 2004, 12:06 PM]Windows has 2 variables for this. One is %time% and other is %date%. You can try them by typing
echo %time%

or

echo %date%

into the comamnd line. I would use it as:

copy backup.rar "%date%backup.rar"

There "/" and ":", this cannot work!

You should reformat it:

echo %date:/=-% %time::=_%

  • Author

mdes you are the man thanks a lot - is it possible to take off the spacers

28-03-2004 21_*

GPM

set x=%date:/=-%.%time::=_%
set x=%x: =0%
echo %x:~0,19%

=> 29-03-2004.08_01_29

See SET/? and FOR/? to see all the possiilities, so you will be able to reverse the date to have yyyy-mm-dd.

To have YYMMDD:

set x=%date%
set yy=%x:~8,2%
set mm=%x:~3,2%
set dd=%x:~0,2%
echo %yy%%mm%%dd%

Edited by mdes

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.