Converting datetime from a number format to "Hour : Minute : Seconds" format using arcade - arcgis

How do I convert 63788415353 (possibly in milliseconds) to "hour:minute:seconds" format using Arcade

Related

Exception while try Date.ParseExact in VB.NET

I'm trying to parse this:
Date.ParseExact("5/19/2012", "M/d/yyyy", myCultureInfo)
In the machine with system date format MM/dd/yyyy, it works fine. But in machine with system date format dd-MMM-yyyy or any date format other than MM/dd/yyyy, it throws exception String was not recognized as a valid DateTime.. So how can I get my code above works regardless to system date format?
I found the solution
Date.ParseExact("5/19/2012", "M/d/yyyy", new Globolization.CultureInfo("en-GB")).toString(myCultureInfo)

Format a Date Time to the Full date/time pattern (short time) in Orchard

Within Orchard CMS (version 1.6) I have a Query that displays a DateTime property called StartDate. When setting it up I chose the "Full date/time pattern (short time)" as the Date format, and then I was rewriting the output as follows:
<My html text here> {Text}
This would render as "My html text here Saturday, April 13, 2013 2:30 PM".
I realized that for users on a different time zone, the date/time was being converted automatically and instead of displaying 2:30 PM (server is at PST), it was displaying 5:30 PM (user was at EST).
Following Bertrand Le Roy's solution here, it worked out nice with one minor issue.
Now my code is this:
<My html text here> {Content.Fields.MyContentType.MyDateTimeField.DateTime.Local}
And here is the result: "My html text here 4/13/2013 2:30:00 PM".
The formatting is not the one I would rather use.
Does anyone know how can I format this to the Full date/time pattern (short time)?
Thank you in advance.
{Content.Fields.MyContentType.MyDateTimeField.DateTime.Local.Format:dddd, MMMM d, yyyy h:mm tt} should do the trick.

Increase precision of apache log to include milliseconds

I have modified the configuration of rsyslogd to disable RSYSLOG_TraditionalFileFormat.
But still the apache log /var/log/apache/error.log is displaying only second-precission.
Is there something else that needs to be configured?
At http://httpd.apache.org/docs/current/mod/mod_log_config.html
you see differemt time formats including mili seconds
Just change from
%t
to
%{%d/%b/%Y:%T}t-%{msec_frac}t for miliseconds
or
%{%d/%b/%Y:%T}t-%{usec_frac}t for microsecs
Example:
16/Mar/2013:22:44:34-634
16/Mar/2013:22:44:34-634200
Documenation apache
%t Time the request was received, in the format [18/Sep/2011:19:18:28 -0400]. The last number indicates the timezone offset from GMT
%{format}t The time, in the form given by format, which should be in an extended strftime(3) format (potentially localized). If the format starts with begin: (default) the time is taken at the beginning of the request processing. If it starts with end: it is the time when the log entry gets written, close to the end of the request processing. In addition to the formats supported by strftime(3), the following format tokens are supported:
sec number of seconds since the Epoch
msec number of milliseconds since the Epoch
usec number of microseconds since the Epoch
msec_frac millisecond fraction
usec_frac microsecond fraction
These tokens can not be combined with each other or strftime(3) formatting in the same format string. You can use multiple %{format}t tokens instead.
strftime(3) formatting
http://man7.org/linux/man-pages/man3/strftime.3.html

VB 2010 Convert UTC Date to dd-MMM-yyyy format

I get the UTC Date and Time using:
Dim UTCN As Date = (Date.UtcNow)
It outputs 8/19/2012 3:48:24 PM
I need to FTP a file that must use the format dd-MMM-yyyy (19-Aug-2012)
My problem is that I must use UTC and it must be in the above format. This will run in various time zones so I do not want to use a fixed offset to convert local to UTC. I know how to FTP and everything else but I can not figure out how can I format UTCM to meet my needs?
Date.UtcNow.ToString("dd-MMM-yyyy")

Need to parse a string to date without padded 0's

I've read through a lot of examples, but the problem I'm facing is the date I'm getting doesn't have leading 0's and all the objective-c stuff I've found has them. So I need to take the date:
4/9/2012 1:30 PM
And determine if it is today. My place was to either grab today's date and compare it to the first part of that string, but as I said before I can't find anyway to make a date in objective c without leading 0's. I'm hoping to avoid parsing that string manually to add leading 0's.
Use an NSDateFormatter object
[dateFormatter setDateFormat:#"h:mm a"];
if you want 0's
[dateFormatter setDateFormat:#"hh:mm a"];
I think that using the single M option for your date format string will allow it to parse a single digit month value:
The possible date formats are specified here
#ynistersix answer is correct. In Data Formatting Guide, they said that NSDateFormatter follows http://unicode.org/reports/tr35/tr35-dates.html
h 1..2 11 Hour [1-12]. When used in skeleton data or in a skeleton
passed in an API for flexible date pattern generation, it should match
the 12-hour-cycle format preferred by the locale (h or K); it should
not match a 24-hour-cycle format (H or k). Use hh for zero padding.
This is consistent with most other languages. Like .NET
"h" The hour, using a 12-hour clock from 1 to 12.
2009-06-15T01:45:30 -> 1
2009-06-15T13:45:30 -> 1
"hh" The hour, using a 12-hour clock from 01 to 12.
2009-06-15T01:45:30 -> 01
2009-06-15T13:45:30 -> 01