Follow Fantora on Twitter
Fantora Word of Classified Ads and Community Forum
Welcome Guest Search | Active Topics | Members | Log In | Register

how to get date in mysql

Options
richard
Posted: Friday, September 02, 2011 10:20:47 AM
Rank: Advanced Member
Groups: Member

Joined: 6/9/2008
Posts: 203
Points: 621
Location: California, USA

how to get date in mysql

I am developing an application in which i wanted to insert date into mysql table field, I know that there is some command in MS SQL that may used as the default value for the fields (DateTime datatype) will generate date & time value when a new row is inserted.

I wanted to apply this in my application but have no idea how to implement that if someone aware of this please let me know.
hari
Posted: Friday, September 02, 2011 10:23:02 AM
Rank: Advanced Member
Groups: Member

Joined: 3/31/2008
Posts: 113
Points: 339
Location: London

how to get date in mysql

From the following link you could use any method like

SEC_TO_TIME(),STR_TO_DATE(),CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP

The Functions that expect date values usually accept datetime values and ignore the time part. Functions that expect time values usually accept datetime values and ignore the date part.


mysql> SELECT something FROM tbl_name
-> WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_col;

Or you may use the above Functions that return the current date or time each are evaluated only once per query at the start of query execution. This means that multiple references to a function such as NOW() within a single query always produce the same result.
hightech
Posted: Monday, September 05, 2011 12:51:19 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2008
Posts: 226
Points: 484
Location: US

how to get date in mysql

I hope this tutorial information will help you
http://www.tizag.com/mysqlTutorial/mysql-date.php

Test Management
Users browsing this topic
Guest

 Related
PHP and seo
Boonex Dolphin PHP script is SCAM!!!
Problem in fetching rows from mysql in php?
remommendations for PHP math CAPTCHA script please
avoid php pages getting hacked
sending email with php
Powerful user administration application
please suggest
updating in MySQL
problem with .htaccess
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Fantora Blog | Discount Shop UK | Discount Shop USA | Discount Shop Canada | Discount Boutique France | Discount Shop Deutschland | Discount Shop Italia | Descuento Shop España

Free Classified ads, Webmaster Forum & Technology Reviews | Fantora Free Classified Ads | Buy & Sell Electronics, Mobile phones & Accessories | fantora Forums Community | Buy & Sell DVD, Games and Consols | Free eBooks & Softwares | SEO & Affiliate Marketing Discussion | Programming Language Forum (.NET, ASP, PHP, SQL) | Free Classified Ads | General Stuff (Movies, Chat, Comics) | Free Online English Movies & Reviews | Free Online Hindi Movies & Reviews | Australia & New Zealand Immigration Forum | Europe immigration forum | Canada Immigration Forum | Ireland Immigration Forum | US Immigration Forum | United Kingdom Immigration Forum

Main Forum RSS : RSS

Powered by: YAF.NET
Copyright © AI Logica All rights reserved.
This page was generated in 0.452 seconds.