mardi 16 mai 2017

datetime saved in database but when i want to call the datetime it is a nil value

I have a datetime, called due_date, that gets saved in agreement table. When i want to display the datetime, it just gives me nil, however Im looking at my db row and its clearly not nil. must be some sort of formating problem.. im using mountain time zone for my whole application as the datetime value called due_date needs to be my timezone anyways. the reason is my due_date is set to the end of the day and i want it to be specifically mountain time. Im using rails and postgres.

As you can see I have an agreement with the due_date entered.. now when i want to display the due_date value it gives me nil. enter image description here

application.rb

 config.time_zone = 'Mountain Time (US & Canada)'
 config.active_record.default_timezone = :local

All in all how can I display @agreement.due_date and give me the same date from the db?

  • also a note is from the picture is that when i try @agreement.created_at it shows up just fine unlike the due_date

Aucun commentaire:

Enregistrer un commentaire