Vb Script On Date&time S’abonner

0
Avatar
Legacy Poster

Hi there.I hope that this isn't a topic that mentioned before as there are quite some topics here regarding the date & time using vb script.

In my case, what i would like to know is as following:

This is part of the field for my label,

Date1: <Empty> Time1: <Empty>

Date2: <Empty> Time2: <Empty>


Basically,Date1 and Time1 will return the current date and time when printing which i have done this part.

Time2 returns the time after 4 hours from current time and date2 returns the date of Time2.

What i concern is when the Time2 is 12.00am until 3.59am,the date2 field should be return the next day date.
The date2 and Time2 is different field,so i was thinking was it able to perform it using vb script?

Eg:
Date1: 27/3 Time1: 9.33pm

Date2: 28/3 <--Time2 date Time2: 1.33am <-- Time1 +4 hour

Any help would be much appreciated.I am using Bartender Automation Enterprise 9.4 to help me.
Thanks..

1 commentaires

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

I would create 2 off-label fields. One that uses the VB script [i]Now()[/i] and one that uses the dateadd function to that. In your example, it would be: [i]DateAdd("h",4,Now())[/i]

Then use whatever [i]Mid()[/i] and [i]Concatenation[/i] you need on your actual printed fields to pull from these off-label fields to make it look how you want.

I can't add links due to forum security, but here is the link: w3schools.com/vbscript/vbscript_ref_functions.asp

Vous devez vous connecter pour laisser un commentaire.