Skip to content

dahu/vim-type-datetime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vim-type-datetime

Date/Time Objects for VimL

Tip
If you like vim-type-datetime and want to share the W00t!, I’m grateful for tips or beverages.

Quick Look

let today = datetime#new()
echo today.to_string()
=> 2014-06-07T08:53:18Z
let yesterday = datetime#new('2014-06-06T08:53:18Z')
echo today.diff(yesterday)
=> 86400
echo datetime#seconds_to_days(today.diff(yesterday))
=> 1
call today.add(datetime#days_to_seconds(1))
echo datetime#seconds_to_days(today.diff(yesterday))
=> 2
call today.sub(datetime#weeks_to_seconds(1))
echo datetime#seconds_to_days(today.diff(yesterday))
=> -5
call today.adjust('-1y')
echo datetime#seconds_to_days(today.diff(yesterday))
=> -371
echo today.to_gregorian()
=> {'day': 1, 'year': 2013, 'month': 6}
echo today.adjust('7m 14d').to_string()
=> 2014-01-15T08:00:00Z

See the provided documentation for more.

About

Date/Time Objects for VimL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published