TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

SQLite juliandday

SQLite juliandday with history, features, advantages, installation, commands, syntax, datatypes, operators, expressions, databases, table, crud operations, clauses, like, glob, limit, and clause, advance sqlite

<< Back to SQLITE

SQLite Julianday Function

The SQLite julianday function facilitates you to apply modifiers and then returns the date as a Julian Day after taking the date as an input.

A Julian Day is the number of days since Nov 24, 4714 BC 12:00pm Greenwich time in the Gregorian calendar. The julianday function returns the date as a floating point number.

Syntax:

julianday(timestring [, modifier1, modifier2, ... modifier_n ] ) 

Example1: Retrieve current date:

SELECT julianday('2017-04-13');
SELECT julianday('2017-04-13 16:45');
SELECT julianday('2017-04-13 16:45:30');
SELECT julianday('now'); 

Output:

SQLite Julianday function 1 SQLite Julianday function 2 SQLite Julianday function 3 SQLite Julianday function 4

Example2: Retrieve First Day of the Month:

SELECT julianday('2017-04-13', 'start of month');
SELECT julianday('now', 'start of month');
SELECT julianday('2017-03-13', '-6 days');
SELECT julianday('now', '-6 days');

Output:

SQLite Julianday function 5 SQLite Julianday function 6 SQLite Julianday function 7 SQLite Julianday function 8

Example2: Retrieve Last Day of the Month:

SELECT julianday('2017-03-07', 'start of month', '+1 month', '-1 day');
SELECT julianday('now', 'start of month', '+1 month', '-1 day');
SELECT julianday('2017-03-07', '+24 days');
SELECT julianday('now', '+24 days');

Output:

SQLite Julianday function 9 SQLite Julianday function 10 SQLite Julianday function 11 SQLite Julianday function 12

Example3: Add/ subtract years/ days on the current date:

SELECT julianday('2017-04-14', '+2 years');
SELECT julianday('now', '+5 years');
SELECT julianday('now', '-7 days'); 

Output:

SQLite Julianday function 13 SQLite Julianday function 14 SQLite Julianday function 15
Next TopicSQLite Now




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf