- insert into mytable values( null, datetime('now') );
- insert into mytable values( null, strftime('%s', 'now'));
1|2009-03-10 18:47:46
The second inserts an unix timestamp:
2|1236711411
It might be best to use that unix timestamp with an integer column type for dates since SQLite doesn't support a datetime one.
It makes comparisons and ordering much easier:
select * from dt where lu > strftime('%s', '2009-03-10');
Output of:
id|luBut the formatting is pretty ugly. :-/
6|1236643200
2|1236711411
3|1236711516
4|1236711518
5|1236711519
Hey what about formatting it within the select with the SQLite datetime function:
select id, datetime(lu, 'unixepoch') lu from dt order by lu;Better but having to add that to each select is kind of a pain. I like adding a new column better:
id|lu
6|2009-03-10 00:00:00
2|2009-03-10 18:56:51
3|2009-03-10 18:58:36
4|2009-03-10 18:58:38
5|2009-03-10 18:58:39
select *, datetime(lu, 'unixepoch') date from dt order by lu;
Alright done playing now... It would be probably be good to add a language extension for a new function called 'now()'. Some other day :)
For more datetime SQLite information, see the SQLite date reference.
Hi, Your blog is really very informative and useful for me. Thanks for sharing this valuable blog.
ReplyDeleteRegards..
Unix Training
A debt of gratitude is in order for your instructive article on programming testing. Your post helped me to comprehend the future and vocation prospects in programming testing. Continue upgrading your web journal with such wonderful article. Ccna Training in Chennai
ReplyDeletehi,we have to sharing now helpful information...i have to learing for lot of information this article.Keep well awesome article..
ReplyDeleteInformatica Training in Chennai
Extraordinary post I might want to thank you for the endeavors you have made in composing this intriguing and learned article.
ReplyDeletedot net training in chennai | Ccna Training in Chennai
Thanks for Sharing this. Just add some more information about altering of table... http://www.trainingbangalore.in/android-training-in-bangalore.html
ReplyDeleteVery useful information..Explain me how to alter the column values in a different table?@ Oracle DBA Training in Bangalore | PHP Training in Bangalore
ReplyDeleteyour adding table to sql is fine . i have doubt in what is the different between sql and plsql? how to insert plsql table ? how do fine to same name in one table to another in sql method? selenium Training in Bangalore |
ReplyDeleteOracle Training in Bangalore
ReplyDeleteOracle DBA Training in Chennai
Thanks for sharing this informative blog. I did Oracle DBA Certification in Greens Technology at Adyar. This is really useful for me to make a bright career..
Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing..
ReplyDeleteWebsphere Training in Chennai
Data warehousing Training in Chennai
ReplyDeleteI am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly..
Selenium Training in Chennai
ReplyDeleteWonderful blog.. Thanks for sharing informative blog.. its very useful to me..
Oracle Training in chennai
ReplyDeleteThanks for sharing such a great information..Its really nice and informative..
SAP Training in Chennai
ReplyDeleteThis post is really nice and informative. The explanation given is really comprehensive and informative..
This information is impressive..I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic
ReplyDeleteAndroid Training In Chennai In Chennai
Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing..
ReplyDeleteUnix Training In Chennai
I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing..
ReplyDeleteSalesForce Training in Chennai
There are lots of information about latest technology and how to get trained in them, like Best Hadoop Training In Chennai in Chennai have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies Hadoop Training in Chennai By the way you are running a great blog. Thanks for sharing this blogs..
ReplyDeleteThis is really an awesome article. Thank you for sharing this.It is worth reading for everyone. Visit us:
ReplyDeleteOracle Training in Chennai
very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.Oracle DBA Training in Chennai
ReplyDeleteWonderful tips, very helpful well explained. Your post is definitely incredible. I will refer this to my friend.SalesForce Training in Chennai
ReplyDeletegreat article!!!!!This is very importent information for us.I like all content and information.I have read it.You know more about this please visit again.Oracle RAC Training in Chennai
ReplyDeleteThank you for the useful post. It helps a lot in my training. I share your blog with my students. Keep posting more.
ReplyDeleteSelenium Training in Chennai
Rajasthan Gram Panchayat 2252 Sathin Recruitment 2015-16
ReplyDeleteThis website has very good content thanks for the article. ............
Latest Govt Bank Jobs 2016
ReplyDeleteIt was helpful and will really help me in building my new blog traffic and increasing my readers per day....................
Thank you for the information you provide, Crazy Bulk
ReplyDeletePenomet
Crazy Bulk Dianabol
Provillus
Growth Factor Plus
Capsiplex Sport
Best Penis Enlargement
Best Male Enhancement
SizeGenetics
Top Diet Pills
Gynexin
Testogen
LIC AAO Recruitment 2016 Online Application Form
ReplyDeleteNice way of explanation and fastidious article...........
Great Article
ReplyDeleteJava Online Course | Java EE Training
Java Training Institutes in Chennai | java j2ee training institutes in chennai | Java Training in Chennai | J2EE Training in Chennai | Java Course in Chennai
Java Interview Questions | Java Training Institutes | Core Java Interview Questions
Very informative and useful one ..informatica training in chennai
ReplyDeleteVery nice post. Thanks for sharing.
ReplyDeletehtml course in chennai
Great the given information and to anlyze that post,i get new information because of all given information very excellent and to developed for you.Thank you so much shared that valuable information.
ReplyDeletedotnet training in chennai
ReplyDeleteThe training was very great and more information to get after end of course,Then the more offers are provided on the training times.
INFORMATICA Training in Chennai
This blog explains the details of most popular technological details. This helps to learn about what are all the different method is there. And the working methods all of that are explained here. Informative blog.
ReplyDeleteInformatica Training in Chennai
very informative blog. Helps to gain knowledge about new concepts and techniques. Thanks for posting information in this blog
ReplyDeleteCCNA Training in Chennai
Thanks a lot for letting me a chance to visit your any pointers. Your article about web design is really impressed me very much.Contact Us Page
ReplyDeleteThanks a lot for letting me a chance to visit your any pointers. Your article about web design is really impressed me very much.Contact Us Page
ReplyDeleteAwesome post..Networking job consultancy in chennai | Networking consultancy in chennai | Networking consultancy
ReplyDeleteSQL is the nice topic which you are discussed..
ReplyDeleteBest SEO training in hyderabad all modules are clearly solved and practice with guide.seo training in hyderabadAnd clearly getting knowledge of seo.
Thank you so much.It's will be like that very so much.
ReplyDeleteHadoop Training in Chennai | Informatica Training in Chennai | Aws Training in Chennai
A good blog. Thanks for sharing the information. It is very useful for my future. keep sharing
ReplyDeletered ball 2 | duck life 2 | happy wheels | Red Ball | Red ball 3 | Flash Games| Tank trouble
Useful Information
ReplyDeleteone and only affiliate agency in south INDIA, earn money online from affiliate network in india
Freshers jobs way provide freshers jobs ,walkins,direct recruitment,openings for freshers and experienced and recruiting experienced and freshers Walkins
ReplyDeleteways to get sqlite nic eposts..
ReplyDeletesap fiori online training in hyderabad
interesting blog..
ReplyDeleteSAP Hana training in hyderabad