# VB Format

**URL:** https://www.finalbuilder.com/forums/t/vb-format/4588
**Category:** Discussion
**Created:** [November 3, 2014, 3:12am UTC](https://www.finalbuilder.com/forums/t/vb-format/4588 "2014-11-03T03:12:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![cgockel](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/ea5d25/32.png) [@cgockel](https://www.finalbuilder.com/forums/u/cgockel)
#### Post date: [November 3, 2014, 3:12am UTC](https://www.finalbuilder.com/forums/t/vb-format/4588/1 "2014-11-03T03:12:34Z")

</div>

Hi,  
  
I need to do some scripting to analyse dates. After some calculation I have a date in format dd.mm.yyyy hh:nn:ss. I need to change this to format yyyymmdd\_hhnn. So I tried “format” which will do very fine in excel VBA. In Automise it produces an error (variable is not defined: “Format”). Is there a chance to use the function “format”? At the moment I use the function “mid”. That works, but is far less elegant.  
  
Is there an action to subtract some minutes from a timespamp in format yyyymmdd\_hhnn in automise? Maybe I don’t need to use DateAdd in VB.  
  
I have Automise 4.0.0.721 and Win 7.  
  
Regards,  
HHK

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [November 9, 2014, 11:49am UTC](https://www.finalbuilder.com/forums/t/vb-format/4588/2 "2014-11-09T11:49:41Z")

</div>

You can put the date value into a date variable with in Automise. Then set its format string to yyyymmdd\_hhnn, then simply use it as a string.   
  
 To perform date maths on the variable there is a Get Date Time action. This allows for getting the date and time now, or simply using the value already stored in a date time variable. It also allows date/time manipulation and writing out the date in the format you require.

---

<div class="post-metadata">

### Author: ![jonathanmeltzer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jonathanmeltzer](https://www.finalbuilder.com/forums/u/jonathanmeltzer)
#### Post date: [February 14, 2020, 7:55pm UTC](https://www.finalbuilder.com/forums/t/vb-format/4588/3 "2020-02-14T19:55:45Z")

</div>

I know this is old, but the final reply is incorrect. You cannot “use the value already stored in a date time variable” to start manipulating. It would be great if you could do date math starting with the value in a date/time variable, but you can only start with the current date/time or a specified date/time, not a date/time variable.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [February 17, 2020, 3:10am UTC](https://www.finalbuilder.com/forums/t/vb-format/4588/4 "2020-02-17T03:10:11Z")

</div>

I’m looking into this. The GetDateTime action really should allow using an existing variable as the source of the datetime.

---

<div class="post-metadata">

### Author: ![jonathanmeltzer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jonathanmeltzer](https://www.finalbuilder.com/forums/u/jonathanmeltzer)
#### Post date: [February 18, 2020, 1:34pm UTC](https://www.finalbuilder.com/forums/t/vb-format/4588/5 "2020-02-18T13:34:16Z")

</div>

An enhancement to this area would be fantastic.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [February 18, 2020, 9:17pm UTC](https://www.finalbuilder.com/forums/t/vb-format/4588/6 "2020-02-18T21:17:19Z")

</div>

I have uploaded a build which enhances the GetDateTime action to allow using a DateTime variable as the source of the date to manipulate

[http://downloads.finalbuilder.com/downloads/automise/500/AT500\_1179.exe](http://downloads.finalbuilder.com/downloads/automise/500/AT500_1179.exe)  
[http://downloads.finalbuilder.com/downloads/automise/500/ATCMD500\_1179.exe](http://downloads.finalbuilder.com/downloads/automise/500/ATCMD500_1179.exe)  
[http://downloads.finalbuilder.com/downloads/automise/500/AutomiseRunner500\_1179.exe](http://downloads.finalbuilder.com/downloads/automise/500/AutomiseRunner500_1179.exe)
