Intelligent Automation & Macro Software  

Go Back   Automation Anywhere, Inc. Forums > Products Zone > Testing Anywhere
Register FAQ Search Today's Posts Mark Forums Read

Testing Anywhere Post messages and questions related to Testing Anywhere here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-17-2012, 09:32 PM
KMuller KMuller is online now
Member
 
Join Date: Dec 2010
Posts: 91
Default Converting dates from 01 to Jan etc..

Does TA have a function to convert dates from numerical to 3-letter format, so 1 to Jan, 2 to Feb, etc?

I'm using the System Variables in Insert Keystrokes, and the application I am testing only accepts date in dd mmm yyyy format (eg 18 Jan 2012), but TA inserts as 18 1 2012 (if I insert $day$ $month$ $year$).

I don't believe it does but thought I would ask.

It would be a useful feature to allow users to create their own system/global variables or functions, rather than create a local variable, then have to copy that to every test that needs to use it.

It looks like I will have to create a long set if 'if' conditions to check for date then convert. It would be good to write that once and save it, then be able to call it from anywhere in any other test.
Reply With Quote
  #2 (permalink)  
Old 01-21-2012, 06:20 AM
forumstaff forumstaff is offline
Senior Member
 
Join Date: Oct 2010
Posts: 521
Default

Hi,

You can work with the $Date$ variable in order to get the date in the desired format.

Attached is a screen-shot which explains the process of editing the default format of the $Date$ variable.

Hope this helps.
Attached Images
File Type: jpg TA - Date Setup.JPG (99.8 KB, 4 views)
Reply With Quote
  #3 (permalink)  
Old 01-22-2012, 04:26 PM
KMuller KMuller is online now
Member
 
Join Date: Dec 2010
Posts: 91
Default

Thanks, unfortunately the format I require is not included - dd mmm yyyy (eg 23 Jan 2012).

Looks like I will have to work on formatting a date format into something I can use inside if loops.
Reply With Quote
  #4 (permalink)  
Old 01-24-2012, 02:53 PM
forumstaff forumstaff is offline
Senior Member
 
Join Date: Oct 2010
Posts: 521
Default

Hi,

Attached is a sample task which converts the date to the format as desired by you. Download and Save the task under 'My Tasks' folder. To locate the path of the 'My Tasks' folder, right click on any of the current tasks and select the 'Locate on Disk' option.

Hope this helps.

P.S. - Please select the Date Format under System Variables to 'dd-mmm-yy' format.
Attached Files
File Type: atmn Forum_Sample KMuller.atmn (709 Bytes, 1 views)
Reply With Quote
  #5 (permalink)  
Old 01-24-2012, 07:37 PM
KMuller KMuller is online now
Member
 
Join Date: Dec 2010
Posts: 91
Default

Thank you, that looks like it will do what I need.

I guess the only problem would be if I needed to use another date format in a different test?

Being a global variable you can only set the format once, and would have to perform some other conversion if that was required by another application....
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -7. The time now is 03:27 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2011 Automation Anywhere, Inc. All rights reserved