Joomla shows dates according to general Server Settings/Server Time Zone configuration or specific User Time Zone.
In your database, all dates are in UTC timezone. Then, when a date shown, it is converted to the appropiate timezone.
If you change the general time zone or a user time zone, dates in your database will remain the same and shown dates will be updates.
If you are saving dates directly to the database, it is recommended to follow the same definition. These conversion routines are very handy: