- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-05-20 11:48 AM
In the attached screenshot, the yellow highlighted portion ALWAYS shows the seconds as 00. Wherein I would like to display the actual seconds of the LocalTime().
Please note, when just the LocalTime() is printed, it correctly displays the seconds, but NOT when combined with the Today() and when the Format function is used.
I'm aware we can separately output Today and LocalTime via different Calc stages and then concatenate into a single Data Item. But is there a way to do the same in a single Calc stage just by formatting the date and time together to show the "seconds" part of the time too?
Expression used in below screenshot is FormatDateTime(Today() & " " & LocalTime(), "dd-MM-yyyy HH_mm_ss")
Thanks.
------------------------------
Vijay
------------------------------
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-05-20 09:39 AM
It seems you can't use LocalTime as text because the seconds portion is lost during the cast that occurs with concatenation (&), Replace or any other text function. This may be a bug, I'm not sure - the support team may be able to help https://portal.blueprism.com/customer-support/how-can-i-get-help-customer-support
As a work around, try something like the following. It's convoluted but it may help you: FormatDateTime(Now()+(LocalTime()-UTCTime()), "ss")
------------------------------
John Carter
Professional Services
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-05-20 06:15 PM
------------------------------
John Carter
Professional Services
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
25-05-20 04:25 AM
Thank you for the response.
The expression ""&LocalTime() shows as 08:35
whereas LocalTime() shows as 08:35:46
None of these would suit my project requirements.
My intention is to use the date as well as time with seconds in a file name because slash / and colon : cannot be used in file name I want to use it with hyphen and underscores as below.
Format: dd-mm-yyyy HH_MM_SS
Output: 25-05-2020 08_35_46
1. This is not achievable through the FormatDateTime function (due to which this thread has been opened).
OR
2. Also the below does NOT work as it again excludes the seconds
Replace(LocalTime(), ":", "_")
OR
3. First store LocalTime() to a Time DataItem
and then use Replace([myTime],":", "_") on that DataItem throws a 'Text cannot be interpreted as a Time' error message.
Using ToTime conversion also throws an error.
It was preferable to use a single line of FormatDateTime function.
But since neither of these 3 options work what are the other options you would like to suggest?
Also maybe you might want to report the bug about FormatDateTime function
Or let me know if there is a way to report a bug.
------------------------------
Vijay
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-05-20 09:39 AM
It seems you can't use LocalTime as text because the seconds portion is lost during the cast that occurs with concatenation (&), Replace or any other text function. This may be a bug, I'm not sure - the support team may be able to help https://portal.blueprism.com/customer-support/how-can-i-get-help-customer-support
As a work around, try something like the following. It's convoluted but it may help you: FormatDateTime(Now()+(LocalTime()-UTCTime()), "ss")
------------------------------
John Carter
Professional Services
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-05-20 02:07 PM
------------------------------
Matt Palmer
Business Process Specialist
Chesapeake Energy
America/Chicago
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-05-20 04:26 AM
Since the Blue Prism time is in UTC, Now() gives the output in UTC time.
So have made the below modifications and this serves the purpose for a passing the local date and time to a file name.
FormatDateTime(Now()+(LocalTime()-UTCTime()), "dd-MM-yyyy hh_mm_ss")
Will check out the link on reporting a bug.
Thanks.
------------------------------
Vijayendra Rao
Technical Lead
T-Systems ICT India Pvt. Ltd.
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-06-20 04:38 AM
UPDATE: As an FYI to anyone who comes up on this thread-
I have reported the bug to Blue Prism and they have agreed to fix it in the next release of Blue Prism.
It will be added in the future release notes with reference as BG-1533
Until then the below line can be used as workaround
FormatDateTime(Now()+(LocalTime()-UTCTime()), "dd-MM-yyyy hh_mm_ss")
Thanks.
------------------------------
Vijay
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-22 08:15 AM
thats exactly what im searching for 🙂
------------------------------
Martin Schirmeister
Business Analyst
neue leben AG
Hamburg
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-22 08:27 AM
Are you saying that the original bug that I reported on 22/5/20 is not working for you because it is not yet fixed in any of the new releases?
------------------------------
Vijay
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-22 08:49 AM
The workaround FormatDateTime(Now()+(LocalTime()-UTCTime()), "dd-MM-yyyy hh_mm_ss") works as i need it 🙂
------------------------------
Martin Schirmeister
Business Analyst
neue leben AG
Hamburg
------------------------------
