doublep / datetime Goto Github PK
View Code? Open in Web Editor NEWLibrary for parsing, formatting, matching and recoding timestamps and date-time format strings.
License: GNU General Public License v3.0
Library for parsing, formatting, matching and recoding timestamps and date-time format strings.
License: GNU General Public License v3.0
I am trying to parse a date string which just contains year, month, day immediately concatenated, so 2022-05-06 would be written as 20220506. This is what I try:
(let* ((parser (datetime-parser-to-float 'java "yyyyMMdd" :timezone 'system))
(parsed (funcall parser "20220506"))))
However, when I execute this, I get
Debugger entered--Lisp error: (datetime-invalid-string "20220506" "yyyyMMdd" "month is out of range")
I get that error even if I add a :non-validating
to the parser's options. I think I got the date format string right. Is this a bug?
I'm excited to use this library, as I suspect it may help with many of my Emacs datetime issues. I had a couple questions about how to make some transformations, and I'm hoping you might be willing to help.
>>> ts = "2018-06-12T22:10:00+03:00"
>>> pendulum.parse(ts).in_tz('UTC').to_iso8601_string()
'2018-06-12T19:10:00Z'
>>> ts = "[2018-06-12 Tue 22:10]"
>>> pendulum.from_format(ts, "[YYYY-MM-DD ddd HH:mm]", tz='America/New_York'
).to_iso8601_string()
'2018-06-12T22:10:00-04:00'
I couldn't figure out how to do these in datetime.el
. Would you be willing to show how to do this, if that functionality is available? Thanks very much!
Leaving directory `/root/.emacs.d/elpa/datetime-20161007.1137'
^L
Compiling file /root/.emacs.d/elpa/datetime-20161007.1137/datetime-pkg.el at Sat Mar 18 0\
8:03:09 2017
Entering directory `/root/.emacs.d/elpa/datetime-20161007.1137/'
^L
Compiling file /root/.emacs.d/elpa/datetime-20161007.1137/datetime.el at Sat Mar 18 08:03\
:09 2017
In end of data:
datetime.el:1235:1:Warning: the function `define-error' is not known to be
defined.
What's this problem?
GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-08 on lamiak, modi
fied by Debian
This doesn't necessarily conflict with your library, but in case you ever wanted to add a datetime-format
function... :) Just thought you should be aware.
I'm playing around with the nativecomp branch of emacs, and I received a (wrong-number-of-arguments (3 . 4) 2)
error on line 1524:
(define-obsolete-function-alias 'datetime-pattern-includes-millisecond-p 'datetime-pattern-includes-second-fractionals-p)
I reviewed the git commit log, and I believe this should be replaced by the following line:
(define-obsolete-function-alias 'datetime-pattern-includes-millisecond-p 'datetime-pattern-includes-second-fractionals-p "0.6.1")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.