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 1028285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:21:49+00:00 2026-05-16T12:21:49+00:00

I would like to convert a given date and integer to a timestamp in

  • 0

I would like to convert a given date and integer to a timestamp in a pl/pgsql function. i’ve never done anything with pl/pgsql before, so i’m somewhat at a loss.

Thanks to the answer by Pablo Santa Cruz, it got this far:

CREATE OR REPLACE FUNCTION to_my_timestamp(mydate date, timeint integer) RETURNS timestamp AS $$
DECLARE
    myhours   integer := timeint / 10000;
    myminutes integer := timeint % 10000 / 100;
    myseconds integer := timeint % 100;
    timestring  text    := myhours || ':' || myminutes || ':' || myseconds;
BEGIN
    RETURN (mydate::text || ' ' || timestring)::timestamp;
$$ LANGUAGE plpgsql;

select to_my_timestamp('2010-08-12',123456);

However, this doesn’t seem to work for me yet. This is the error I get using pgadmin3 on Ubuntu:

ERROR:  syntax error at end of input
LINE 9: $$ LANGUAGE plpgsql;
        ^

********** Error **********

ERROR: syntax error at end of input
SQL state: 42601
Character: 377

Any help is greatly appreciated 🙂

  • 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-16T12:21:49+00:00Added an answer on May 16, 2026 at 12:21 pm

    Try changing your return value to:

    RETURN (mydate::text || ' ' || timestring)::timestamp;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 509k
  • Answers 509k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can create an assembly at runtime so you could… May 16, 2026 at 4:33 pm
  • Editorial Team
    Editorial Team added an answer This (old) JUnit best practices article puts it like this:… May 16, 2026 at 4:33 pm
  • Editorial Team
    Editorial Team added an answer I got it to work with this code. NSString *urlstr… May 16, 2026 at 4:33 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I would like to convert T to T[] if it is an array. static
I have a phone number (000) 000-0000, I would like to convert it back
I have a string in this format dd.mm.yy (23.08.10). I would like to convert
At our sports centre, I would like to analyse the number and types of
I feel like I've seen this question asked before, but neither the SO search
I am totally 100% stuck on this, no answer ever given for timezone support
I have an access database given to me where all the dates are stored
Item in the recordset rstImportData(Flat Size) is = Null With that, given the following
I have just done what appears to be a common newbie mistake : First
I have const char* FilePathName which looks like this: C:\ImportantFile.hex And an int id

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.