I have used the Time.new method in my rails application to get the current date and I want to store this date into a variable of type datetime . I am using postgresql. Now if I insert the date of this format manually into table using pgAdminIII ,it is working fine but if I try to insert the time into the table via a controller code then it is storing a different date time into table.
For example suppose the current time is:-
2016-06-15 17:29:29
And if I insert this date and time into the table manually by copying this line from webpage then it is working fine.
But my controller code to store it into table is inserting something else like
2016-06-15 11:41:39
Note: I have used only Time.new (time region is not specified in my code)