Hi Adrain,
Thank you for the explanation. I was trying to send some data to a
Javascript library worked with ISO dates. But you are correct I wanted
not IYYY, that totally sliped by me.
Thanks,
-Steve
On 11/30/2014 4:19 PM, Adrian Klaver wrote:
On 11/30/2014 01:05 PM, Stephen Woodbri
On Nov 30, 2014, at 1:05 PM, Stephen Woodbridge wrote:
> Hi,
>
> I am have a problem when I format a timestamp in that it is changing the
> year. This can't be right, so either I don't understand
You're using "IYYY" which is the "ISO year", which is based on Mondays or
Thursdays or something
On 11/30/2014 01:05 PM, Stephen Woodbridge wrote:
Hi,
I am have a problem when I format a timestamp in that it is changing the
year. This can't be right, so either I don't understand or I have found
a nasty corner case bug.
This does not happen on all dates
select '2014-12-31 00:00:00'::timest
Hi,
I am have a problem when I format a timestamp in that it is changing the
year. This can't be right, so either I don't understand or I have found
a nasty corner case bug.
This does not happen on all dates
select '2014-12-31 00:00:00'::timestamp without time zone,
to_char('2014-12-3
On 07/30/2013 08:34 AM, Ingmar Brouns wrote:
Thanks for your time, appreciate it! As a dirty alternative, you could also do
something like:
select translate(5.000::text,'.',substr(to_char(.0),2,1));
Not so nice, but would work. Though I still feel there should be a more
elegant of doing this.
On Tue, Jul 30, 2013 at 4:42 PM, Adrian Klaver wrote:
> On 07/30/2013 03:03 AM, Ingmar Brouns wrote:
>>
>> On Mon, Jul 29, 2013 at 3:12 PM, Ingmar Brouns wrote:
>
>
>>>
>>
>> anyone? Giving a locale corresponding textual representation
>> of a numerical value keeping the exact nr of decimal digit
On 07/30/2013 03:03 AM, Ingmar Brouns wrote:
On Mon, Jul 29, 2013 at 3:12 PM, Ingmar Brouns wrote:
anyone? Giving a locale corresponding textual representation
of a numerical value keeping the exact nr of decimal digits
must be a fairly common use case. Would it be an idea to
implement a t
On Mon, Jul 29, 2013 at 3:12 PM, Ingmar Brouns wrote:
> On Mon, Jul 29, 2013 at 1:24 PM, Ingmar Brouns wrote:
>> Hi,
>>
>> I need to convert some numerical values to text using the decimal
>> separator that corresponds to the current locale. However, I do
>> not want to lose information by paddin
On 07/29/2013 07:27 AM, Ingmar Brouns wrote:
On Mon, Jul 29, 2013 at 3:45 PM, Adrian Klaver wrote:
On 07/29/2013 04:24 AM, Ingmar Brouns wrote:
Hi,
This work?:
test=> select replace(1.500::text, '.', ',');
replace
-
1,500
(1 row)
that would work, but that requires keeping
On Mon, Jul 29, 2013 at 3:45 PM, Adrian Klaver wrote:
> On 07/29/2013 04:24 AM, Ingmar Brouns wrote:
>>
>> Hi,
>>
>> I need to convert some numerical values to text using the decimal
>> separator that corresponds to the current locale. However, I do
>> not want to lose information by padding with
On 07/29/2013 04:24 AM, Ingmar Brouns wrote:
Hi,
I need to convert some numerical values to text using the decimal
separator that corresponds to the current locale. However, I do
not want to lose information by padding with zero decimals or
truncating zero decimals. So I basically want a text ca
On Mon, Jul 29, 2013 at 1:24 PM, Ingmar Brouns wrote:
> Hi,
>
> I need to convert some numerical values to text using the decimal
> separator that corresponds to the current locale. However, I do
> not want to lose information by padding with zero decimals or
> truncating zero decimals. So I basic
Hi,
I need to convert some numerical values to text using the decimal
separator that corresponds to the current locale. However, I do
not want to lose information by padding with zero decimals or
truncating zero decimals. So I basically want a text cast that
also replaces the dot by a comma. I've
Message-
From: Steve Crawford [mailto:scrawf...@pinpointresearch.com]
Sent: Friday, March 18, 2011 1:05 PM
To: jonathansfl
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] TO_CHAR(timestamptz,datetimeformat) wrong after DST
change
On 03/18/2011 07:59 AM, jonathansfl wrote:
> My TO_
On 03/18/2011 07:59 AM, jonathansfl wrote:
My TO_CHAR function is now an hour off thanks to Daylight Savings Time.
The dates are correct (I'm in EST: TZ=-04) but my function now returns TIME
an hour early.
(prior to DST we were TZ=-05).
TIMESTAMPTZ data (v_dt): 2011-03-17 18:21:50-04
FUNCTION SN
My TO_CHAR function is now an hour off thanks to Daylight Savings Time.
The dates are correct (I'm in EST: TZ=-04) but my function now returns TIME
an hour early.
(prior to DST we were TZ=-05).
TIMESTAMPTZ data (v_dt): 2011-03-17 18:21:50-04
FUNCTION SNIPPET: to_char(v_dt, 'mm/dd/ hh:mi AM')
Bruno,
Thanks for the response. The only problem is that FM removes all the leading
spaces. I may have been unclear in stating my problem. I want the padding on
the left; however, I don't want the extra space for the sign (+,-) that gets
prepended to the string. This output shows what I mean:
On Tue, Dec 13, 2005 at 11:30:36 -0500,
Terry Lee Tucker <[EMAIL PROTECTED]> wrote:
>
> On Tuesday 13 December 2005 11:20 am, John Sidney-Woollett saith:
> > Not sure if there is a numeric formatting option that allows what you want.
> >
> > But how about?
> >
> > substr(to_char(1029, '9,999'),2
On Tuesday 13 December 2005 11:20 am, John Sidney-Woollett saith:
> Not sure if there is a numeric formatting option that allows what you want.
>
> But how about?
>
> substr(to_char(1029, '9,999'),2)
That's so simple, I'm embarrased ;o)
Thanks for the help...
>
> John
>
> Terry Lee Tucker said:
Not sure if there is a numeric formatting option that allows what you want.
But how about?
substr(to_char(1029, '9,999'),2)
John
Terry Lee Tucker said:
> Greetings List:
>
> I am using to_char to format numeric data into a string that is ultimately
> displayed in an XmText widget. Much of the
Greetings List:
I am using to_char to format numeric data into a string that is ultimately
displayed in an XmText widget. Much of the numeric data is always going to be
positive. In some of the windows that display this data, space is at a
premium. Basically, I need to display something like 1,
Thanks, sometimes the obvious just passes me by. :-(
>If the number is negative there needs to be room for the minus sign...
"Martijn van Oosterhout" wrote in message
news:[EMAIL PROTECTED]
---(end of broadcast)---
TIP 2: you can get off al
If the number is negative there needs to be room for the minus sign...
On Tue, Mar 01, 2005 at 09:25:02AM -, Ben Trewern wrote:
> >From the docs:
>
> "FM suppresses leading zeroes and trailing blanks that would otherwise be
> added to make the output of a pattern be fixed-width"
>
> It work
>From the docs:
"FM suppresses leading zeroes and trailing blanks that would otherwise be
added to make the output of a pattern be fixed-width"
It works now but for one I don't understand why the space is added in the
firs place and two I think the docs don't tell the whole story ie leading
bl
"Ben Trewern" <[EMAIL PROTECTED]> writes:
> It seems that to_char(1, '000') gives a string " 001" with a space in front.
> Is this a bug?
No.
Possibly you want 'FM000'.
regards, tom lane
---(end of broadcast)---
TIP 1: sub
Ben Trewern wrote:
Is there any reason why :
SELECT char_length(to_char(1, '000'));
Gives a result
char_length
-
4
(1 row)
It seems that to_char(1, '000') gives a string " 001" with a space in front.
Is this a bug?
Regards,
Ben
Try formatting the result:
SELECT char_leng
Is there any reason why :
SELECT char_length(to_char(1, '000'));
Gives a result
char_length
-
4
(1 row)
It seems that to_char(1, '000') gives a string " 001" with a space in front.
Is this a bug?
Regards,
Ben
---(end of broadcast)--
On Fri, Jan 14, 2005 at 11:36:26 -0800,
[EMAIL PROTECTED] wrote:
> I saw the note in the docs that to_char(interval, text) is deprecated, and
> will be removed. I searched the archives and saw more mentions of this,
> but no real explanation as to how it is planned for us to get consistent
> out
I saw the note in the docs that to_char(interval, text) is deprecated, and
will be removed. I searched the archives and saw more mentions of this,
but no real explanation as to how it is planned for us to get consistent
output formatting when querying a column containing interval data.
For exampl
I asked:
>>to_char(0,'.99')
>>
>>returns .00 rather than 0.00.
Dave Smith replied:
to_char(0,'9990.00')
?
Thanks Dave, that's embarrassingly obvious...
I note that the examples in the documentation don't have a 0 before the
decimal point, e.g. this one
to_char(148.5, 'FM999.990')
to_char(0,'9990.00')
?
On Mon, 2005-01-10 at 22:48 +, Phil Endecott wrote:
> Dear All,
>
> I was a bit surprised to find that
>
> to_char(0,'.99')
>
> returns .00 rather than 0.00.
>
> Is this a bug or a feature? How do I get what I want?
>
> (This is with 7.4.2. Appolog
Dear All,
I was a bit surprised to find that
to_char(0,'.99')
returns .00 rather than 0.00.
Is this a bug or a feature? How do I get what I want?
(This is with 7.4.2. Appologies if it is a known problem. The search
form in the list archives seems to split words on _, so looking for
On Monday 16 February 2004 19:15, Wei Wang wrote:
> I get compile error for this code:
>
>
> for i in 1..arg_count-1 LOOP
> RAISE NOTICE quote_literal(to_char(i, ''9''));
> END LOOP;
>
> where arg_count = 3.
>
> I tried RAISE NOTICE to_char(i, ''9''); as well.
> to_char returns text, right? Then w
Clark Endrizzi said:
> I just sent this twice before with the wrong email address so it didn't
> go through, that is why I am sending this so that it will get through.
> I hope this isn't causing issues.
>
> Hi guys. I certainly hope this is the correct place to email this. I'm
> having an iss
I just sent this twice before with the wrong email address so it didn't go through, that is why I am sending this so that it will get through. I hope this isn't causing issues.
Hi guys. I certainly hope this is the correct place to email this. I'm having an issue that I have really tried to
On Tuesday 17 February 2004 12:37, Wei Wang wrote:
> In that case, how do I RAISE NOTICE a text variable such as:
> DECLARE tempstring text;
> BEGIN
> RAISE NOTICE tempstring;
RAISE NOTICE ''%'',tempstring;
Don't forget to double-up (or bacslash-escape) your quotes.
--
Richard Huxton
Archon
TECTED]>
Sent: Monday, February 16, 2004 8:24 PM
Subject: Re: [GENERAL] to_char problem
> On Monday 16 February 2004 19:15, Wei Wang wrote:
> > I get compile error for this code:
> >
> >
> > for i in 1..arg_count-1 LOOP
> > RAISE NOTICE quote_literal(to_char(i,
I'm trying to pull the current year with the following query:
select to_char(now(), '');
This is fine. Now, I would like to select this date in different time
zones.
Normally I just do:
select now() at time zone 'utc';
I guess I need a combination of the 2 queries above - one that asks fo
Fred Yankowski <[EMAIL PROTECTED]> writes:
> In PostgreSQL 7.0.3 (on NT), the expression
> to_char(date '2001-04-01', 'dd')
> evaluates to '31', which is a bit surprising.
It's just a bug: date to timestamp conversion did the wrong thing on
DST forward transition days in 7.0.3 and before.
In PostgreSQL 7.0.3 (on NT), the expression
to_char(date '2001-04-01', 'dd')
evaluates to '31', which is a bit surprising. But
to_char(timestamp '2001-04-01', 'dd')
evaluates to '01' as I would expect. Doing a bit of RTFM, it looks
like the various "Date/Time Functions" actua
Hi again, thanks for all your responses, now that I've taken a better look
at my problem, let me rephrase my question
I'm moving an app. from oracle to postgres, and I'm having problems with
the data type "time" I was able to format oracle's datatype "date" to
anything I'd like using to_char func
hi all,
where can I find info about the function to_char
TIA
--Yohans
~~~
Yohans Mendoza System Analyst
[EMAIL PROTECTED]Sirius Images Inc.
http://www.sir
42 matches
Mail list logo