Answered by:
VS2012 SSRS -Date/Time Format

Question
-
Hi all,
I created a report in VS 2012, and I want to have a field to show when this report was downloaded. I want to report:
1) Date: dd-MMM-yyyy
2) Time
3) Time Zone from which report was downloaded, e.g. ESTSo far I have Report: (as of <<Expr>>) where for Expr= dd-MMM-yyyy HH:mm but my time always comes as 00 and I can't figure out how to add time zone. Does anyone know?
Any thoughts?
Tuesday, December 2, 2014 4:05 PM
Answers
-
Use this Expression:
=format(Globals!ExecutionTime, "dd-MMM-yyyy hh:mm:ss tt") & " (" & System.Text.RegularExpressions.Regex.Replace( TimeZone.CurrentTimeZone.StandardName, "[^A-Z]","") & ")"
Regards, Saad
- Marked as answer by Donyc Friday, December 5, 2014 1:13 PM
Friday, December 5, 2014 8:55 AM
All replies
-
Check these
http://stackoverflow.com/questions/8483402/ssrs-showing-the-correct-execution-time-on-a-two-page-report
https://social.msdn.microsoft.com/forums/sqlserver/en-US/52bd0deb-86af-437f-bf19-b0a1cd397f44/how-display-timezone-in-ssrs-report
If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'
- Proposed as answer by Mamatha Swamy Tuesday, December 2, 2014 8:05 PM
Tuesday, December 2, 2014 8:05 PM -
I found below which works:
=Globals!ExecutionTime & “ (” & TimeZone.CurrentTimeZone.StandardName & “)”but the only problem is I need my date to be in format: dd-MMM-yyyy
Any idea how can I combine those 2?
Thanks!
Thursday, December 4, 2014 3:28 AM -
Use this:
=format(Globals!ExecutionTime, "dd-MMM-yyyy hh:mm:ss tt") & “ (” & TimeZone.CurrentTimeZone.StandardName & “)”
Regards, Saad
- Edited by Mohd Saad Thursday, December 4, 2014 5:18 AM
Thursday, December 4, 2014 5:15 AM -
Thanks so much Saad! one question, the time zone comes up as "Easter Standard Time" is there a way for it give abbreviation instead > EST?
Thursday, December 4, 2014 3:37 PM -
Use this Expression:
=format(Globals!ExecutionTime, "dd-MMM-yyyy hh:mm:ss tt") & " (" & System.Text.RegularExpressions.Regex.Replace( TimeZone.CurrentTimeZone.StandardName, "[^A-Z]","") & ")"
Regards, Saad
- Marked as answer by Donyc Friday, December 5, 2014 1:13 PM
Friday, December 5, 2014 8:55 AM -
thanks! it works!Friday, December 5, 2014 1:13 PM
-
Hi Saad,
I did some testing and ran into issue..it looks like server is located in Netherlands and when I pull report on CRM it actually CUT time!
is there a modify that time CET for Central Europe Time where time would be just +1 hour later?
Friday, December 5, 2014 4:19 PM -
any thoughts if this is possible to push time 1 hour and change zone to CET?Monday, December 8, 2014 2:21 AM
-
First clarify you requirements. You want Local time when the report ran or +1 the time time when Report ran. Also IF you want to change the time zone to CET for all reports you can add CET after the global execution time.
Regards, Saad
Monday, December 8, 2014 5:41 AM -
Hi Saad,
I am looking to add a time stamp when I run the report. Ideally where the user is, but I just found out that it always pulls where the server is located(CUT). Im not sure if there is even easy solution to show time per each user who ran the report so I would be ok if the time just was at least CET for all users then. But now when I run it now I get a time stamp where the server is located so the time is always in CUT.
So if we go for general CET time then for example, when I run a report now it says 5PM CUT, I would need it in CET zone time which is +1 hour. I am not sure if that it is best to just add 1 hour because what happens when there is time change in winter/summer.
Any idea?
Dan
Monday, December 8, 2014 2:09 PM -
Hi Saad, any thoughts how can I report this CET time?Tuesday, December 9, 2014 9:25 PM
-
Try this and see if it helps
Globals!ExecutionTime.ToLocalTime
Regards, Saad
Wednesday, December 10, 2014 5:15 AM -
Thanks but: Globals!ExecutionTime.ToLocalTime
show server time which is CUT, it also doesn't show the zone.. What I was hoping is for it to show time and zone where report is pulled from but I would even be ok if one time for the CET is reported no matter what time zone.. I just don't want the CUT time stamp(where servers are).. Is that even possible?
Wednesday, December 10, 2014 12:50 PM