Wednesday, September 11, 2013

How to add time in mysql ?

SELECT ADDTIME('1984-05-31 23:59:59', '0 0:15:01');

Here you can see 23 Hrs 59 Minutes and 59 Seconds is added with 0 Hrs, 15 Minutes and 01 Seconds

The Result is '1984-06-01 00:15:00'

Oops My Birthday....

Thursday, August 29, 2013

How to make Time ?

Hi,

Sorry If you have been misguided into this blog, well its technical and nothing Out of the world

I found this site very useful,
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html

The site has all the Time/Date related API's, There are a lots of FUN things available there
like

a)How to make time ?

SELECT MAKETIME(9,45,45);

SELECT MAKETIME(9,45,61); --------------WILL GIVE YOU NULL VALUE !!!

b)How to make date ?


How to get Present Time difference between two times / two dates in mysql

SELECT NOW(), SLEEP(3), SYSDATE();


I found this site very useful,
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html

The site has all the Time/Date related API's, There are a lots of FUN things available there
like

a)How to make time ?
b)How to make date ?
and etc.............




How to get the difference between two dates / time in mysql

CREATE TABLE users (
  users_name varchar(20) NOT NULL,
  users_starttime datetime DEFAULT '00-00-0000 00:00:00' NOT NULL,
  users_endtime datetime DEFAULT '00-00-0000 00:00:00' NOT NULL
);

insert into users (users_name, users_starttime) values('Balaji', NOW());

update users set users_endtime = NOW();

select * from users;

SELECT TIMEDIFF(users_endtime,users_starttime) FROM users;
SELECT TIMESTAMPDIFF(SECOND,users_starttime,users_endtime) FROM users;

Sunday, June 23, 2013

Wednesday, May 22, 2013

Latest Train Updates - http://railradar.trainenquiry.com/

http://railradar.trainenquiry.com/

I found this site very useful for trains running in India, normally we got to a lot of places in net and over phone to get the latest update on the trains, but this site just solves the probelm......Go and have a peek in youself.

Happy Rides.

Tuesday, May 21, 2013

how to convert an int to string in java

Say int i = 10;

and String compare = "10";----Value from the Program

You can use either of these

1) Integer.toString(i)

                or

2)String.valueOf(i)

(i.e)

String convertedValue = Integer.toString(i);


if(convertedValue.equals(compare)){
----------Which turns out to be true
}