How to parse date/time of the following format? - date

I have time strings of the following format
November 05, 2016, 01:02:31 PM
Does any one know how can I parse them into golang Time?

https://golang.org/pkg/time/#Parse
time.Parse(`January 02, 2006, 15:04:05 PM`, `November 05, 2016, 01:02:31 PM`)
https://play.golang.org/p/LOD5D-8i_U

Related

postgresql - how to extract a list of past and known future offset changes for a timezone

Postgresql is rather good at handling timezones, using the classic tzdata database.
The server can convert past and future timestamps between the different timezones, following the rules in tzdata (offsets, dst changes, ..)
Is there a simple and efficient way, for a given timezone and a given date range, to extract all the timestamps within that range when a timezone modification event occured ?
the result should more or less contain the equivalent of the output of the zdump linux command.
zdump -v /usr/share/zoneinfo/America/Los_Angeles | grep 2017
Sun Mar 12 09:59:59 2017 UTC = Sun Mar 12 01:59:59 2017 PST isdst=0 gmtoff=-28800
Sun Mar 12 10:00:00 2017 UTC = Sun Mar 12 03:00:00 2017 PDT isdst=1 gmtoff=-25200
Sun Nov 5 08:59:59 2017 UTC = Sun Nov 5 01:59:59 2017 PDT isdst=1 gmtoff=-25200
Sun Nov 5 09:00:00 2017 UTC = Sun Nov 5 01:00:00 2017 PST isdst=0 gmtoff=-28800
select d::date
from (
select
d at time zone 'America/Los_Angeles' as la,
lead(d at time zone 'America/Los_Angeles') over (order by d) as la_,
d
from generate_series (
'2017-01-01'::timestamp,
'2017-12-31', '1 day'
) gs (d)
) s
where la::time <> la_::time;
d
------------
2017-03-12
2017-11-05

Why is Eclipse - Tomcat 7 displaying all text in color red in console

I'm using Eclipse Kepler with Tomcat 7, I'm just testing a simple JSP page (test.jsp). It runs well in browser however all text in console is displayed in color red.
I have checked in Window/Preferences/(Run/Debug) properties and all seams to be fine.
The text from the console is the following:
Jan 07, 2015 3:31:07 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance
in production environments was not found on the java.library.path:
C:\Java\jdk1.8.0_05\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;...etc
Jan 07, 2015 3:31:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 07, 2015 3:31:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 07, 2015 3:31:08 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1676 ms
Jan 07, 2015 3:31:08 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 07, 2015 3:31:08 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.56
Jan 07, 2015 3:31:11 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took
[1,076] milliseconds.
Jan 07, 2015 3:31:12 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor
C:\MauricioFiles\ECLIPSE\Eclipse_JEE7_I\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf
\Catalina\localhost\Servlets_JSP_chapter21_musicII.xml
Jan 07, 2015 3:31:12 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to
'org.eclipse.jst.jee.server:
Servlets_JSP_chapter21_musicII' did not find a matching property.
Jan 07, 2015 3:31:12 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor
C:\MauricioFiles\ECLIPSE\Eclipse_JEE7_I\.metadata\.plugins
\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\Servlets_JSP_chapter21_musicII.xml has
finished in 862 ms
Jan 07, 2015 3:31:12 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 07, 2015 3:31:13 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 07, 2015 3:31:13 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4236 ms
Is something wrong with the proyect or is there a way to display text in black (just error in red)?
Thank you a lot!!
The text that is in red is being written to the System.err stream, the text in black is written to System.out. Nothing is inherently wrong, that's just how the system is differentiating the output streams. You can configure the display to your liking by right clicking in the console and selecting "Preferences"

Looking for Google Apps script to find and highlight dates from past month in red

I have a Google spreadsheet with columns I and J with data as headers Est Closing Month and Est Closing Calendar Year respectively, I need a script which will loop through columns I and J and find dates which are in the past month of this year and highlight them in Red.
Following is example data
ColI ColJ
Aug 2014
Nov 2014
Aug 2014
Jul 2014
Jul 2014
Dec 2014
Dec 2014
After I run the script the output put should be
Aug 2014
Nov 2014
Aug 2014
Jul 2014 -> Both Cells should be in red
Jul 2014 -> Both Cells should be in red
Dec 2014
Dec 2014
Thank you for all the help.
have you tried conditional formatting ?

How do I interpret dates like 1394862706?

I don't know how to interpret this date format:
1394862706,
1394862645,
1400258321,
1400258250 etc. (each block is a different date)
Does someone understand in which format are them?
I believe they're Unix timestamps. For example, 1400258250 maps to 4:37:30 May 16 2014. They represent the number of seconds that have elapsed since the Unix epoch, January 1, 1970.
Here's a nice timestamp converter.
As others have noted, the 10-digit numbers are Unix timestamps, the number of seconds since 1970-01-01 00:00:00 +00:00, the Unix Epoch.
If you have GNU date, you can use the -d option (or --date) and the # prefix to analyze them (here, with TZ=US/Pacific or TZ=America/Los_Angeles):
$ for ts in 1394862706 1394862645 1400258321 1400258250; do date -d #$ts; done
Fri Mar 14 22:51:46 PDT 2014
Fri Mar 14 22:50:45 PDT 2014
Fri May 16 09:38:41 PDT 2014
Fri May 16 09:37:30 PDT 2014
$
If you add the -u or --utc option, then you get the output:
Sat Mar 15 05:51:46 UTC 2014
Sat Mar 15 05:50:45 UTC 2014
Fri May 16 16:38:41 UTC 2014
Fri May 16 16:37:30 UTC 2014

date and datestring connection

I'm trying to write a code that visits in another website
The other page uses some sort of logic for the dates, for example:
634655520000000000 - 23/2/2012 - Feb 23, 2012
634649472000000000 - 16/2/2012 - Feb 16, 2012
634641696000000000 - 7/2/2012 - Feb 7, 2012
634631328000000000 - 26/1/2012 - Jan 26, 2012
http://www.tase.co.il/TASE/Statistics/ShortSale/ShortSaleData/ShortSalesWeekly.htm?action=1&issubmitted=1&dt=634679712000000000&dateLinksID=3
is the mar 22, 2012
can someone figure out a connection between the dates and this var?
That is the time starting from 1.1.1601 in steps of 100 nano seconds.