Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7026857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:10:20+00:00 2026-05-28T00:10:20+00:00

In Postgres, is it possible to change the default format mask for a timestamp?

  • 0

In Postgres, is it possible to change the default format mask for a timestamp?
Right now comes back as:

2012-01-03 20:27:53.611489

I would like resolution to minute like this:

2012-01-03 20:27

I know I can do this on individual columns with to_char() as or stripped down with a substr() by the receiving app, but having it formatted correctly initially would save a lot of work and reduce a lot of errors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:10:21+00:00Added an answer on May 28, 2026 at 12:10 am

    In postgres, you can change the default format mask for datetimes – using the set datestyle option; the available options can be found here (see 8.5.2. Date/Time Output).

    Unfortunately, all the available options include the number of seconds – you will therefore need to reformat them either in the query or the application code (if applicable).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to change the natural order of columns in Postgres 8.1? I
Is it possible to change the constraint name in Postgres? I have a PK
In postgres I am fairly sure you can do something like this SELECT authors.stage_name,
In postgres you can do a comparison against multiple items like so: SELECT 'test'
I currently have a Postgres 8.4 database that contains a varchar(10000) column. I'd like
Is it possible to have the postgres database dump(pg_dump) using SQLAlchemy? i can get
With doctrine syntax using postgres as database, is it possible to generate a query
Is it possible to define in which schema new tables get created by default?
I was wandering if it's possible to create a user on a postgres database
I'm running Postgres 8.4 on Windows XP and I'm wondering if it is possible

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.