Google Sheet convert time format to another - date

Whenever I extract raw data from this specific tool I am getting the date format of
Fri Sep 2 10:29:50 2022
Fri Sep 9 10:31:01 2022
Mon Sep 12 10:32:28 2022
and I am having a hard time converting it to this kind of format in Google Sheet
9/2/2022 10:29
9/9/2022 10:31
9/12/2022 10:32
Already tried using different of formating but still can't convert it to the above format.

use:
=ARRAYFORMULA(IF(A1:A5="",,REGEXREPLACE(TRIM(A1:A5),
"(.*) (.*) (.*) (.*) (.*)", "$2/$3/$5 $4")*1))
then do:

Date value
=ArrayFormula(IF(A2:A="",,
DATEVALUE(REGEXEXTRACT(TRIM(A2:A), "(.+\d{1,2}) \d{1,2}:")&" "&REGEXEXTRACT(A2:A, " (....\z)"))+
TIMEVALUE(REGEXEXTRACT(TRIM(A2:A), " (\d{1,2}:\d{1,2}:\d{1,2}) "))))
Custom date and time formats
Custom number formats

Related

Golang parsing date in RFC822Z format without leading zero [duplicate]

This question already has answers here:
How to format current time using a yyyyMMddHHmmss format?
(6 answers)
Convert time.Time to string
(6 answers)
Parsing RFC-3339 / ISO-8601 date-time string in Go
(8 answers)
Parse string as a time.Time value [duplicate]
(1 answer)
Parsing date/time strings which are not 'standard' formats
(4 answers)
Closed 2 months ago.
I have a date string I can't control that I'm trying to parse into a Date.
The format most closely resembles RFC822Z.
RFC822Z = "02 Jan 06 15:04 -0700"
Reference: https://yourbasic.org/golang/format-parse-string-time-date-example/
However, it does not have the leading zero.
Example: "5 Dec 2022 20:15:21 +0000"
The way I saw in other posts, is to write a manual format.
parseTime, timeParseError = time.Parse("2 Jan 2006 15:04:21 -0700", stringDate)
However, when I try that, I get a warning:
parsing time "2 Jan 2006 15:04:21 -0700" as "2 Jan 2006 15:04:21 -0700": cannot parse " -0700" as "1" (SA1002)
Running it despite the warning fails to part, unsurprisingly.
Your time format doesn't match - in your example you have "5 Dec 2022", but you are using "2 Jan 06", and in your reference format you hvae "15:04:21" but it should be "15:04:05".
Your reference format should be 2 Jan 2006 15:04:05 -0700 not 2 Jan 06 15:04:21 -0700
https://go.dev/play/p/Shc381WgB6_7

I want to display 2-March-2019 is like '02-Mar-2K19'

I want to display date year like 2K19
In Php or wordpress
Example 08 OKT 2019 to 08 OKT 2K19
strftime("%d %b 2K%y");
Obviously this won't work for dates prior to 1 January 2000.

printing 'date' in unix

The command echodate gives output : Sun Aug 20 08:14:50 2017.
I want the date format in : Aug 20.
I tried command : echodate|awk '{print $2, $3}', which outputs to what I want: Aug 20
Is there any other method?
If you look into the date man page, you'll see it's quite capable of delivering what you want without passing the output through a textual filter - you can just use + to specify the output format, such as:
pax> date +"%b %d"
Aug 20

Date format toUTCString in Lua

I have a question regarding date formatting in Lua (Luajit). I need to get UTC string, for example, like I would do it in JavaScript:
var date = new Date()
console.log(date.toUTCString()) // "Fri, 06 Dec 2013 14:05:28 GMT"
Unfortunately in Lua I cannot find possibility to format date this way:
print(os.date()) -- Fri Dec 6 16:06:43 2013
From the Lua manual:
If format starts with '!', then the date is formatted in Coordinated Universal Time. [...]
If format is not "*t", then date returns the date as a string, formatted according to the same rules as the ANSI C function strftime.
Based on this and a little documentation referencing, it's quite simple to construct a format string that resembles JavaScript's toUTCString format.
> =os.date('!%a, %d %b %Y %H:%M:%S GMT')
Fri, 06 Dec 2013 14:27:34 GMT

Convert seconds to date from Jan 01 1901 in unix/linux

im trying to convert a time stamp in seconds from Jan 01 1901 to the current date.
for example,
time stamp 3465468225 translate to a date in 2010. does anyone know of a way to do this in unix/linux? thanks.
In R, it is as simple as this:
> as.POSIXct(3465468225, origin="1901-01-01")
[1] "2010-10-25 15:03:45 CDT"
>
This uses appropriate wrappers around C-level calls gmtime() / localtime() plus time formatting via strftime().
On GNU and POSIX systems you can obtain the date string using seconds since Epoch (1970-01-01 00:00:00 UTC) as:
$ date --date=#1289495920
Thu Nov 11 12:18:40 EST 2010
You should handle the offset since Jan 01 1901 yourself.