Thread: [Arsperl-users] Inserting a date in ARSPerl
Brought to you by:
jeffmurphy
|
From: Pittman, T. <Tim...@re...> - 2007-10-17 16:22:40
|
I have been having considerable difficulty trying to use ARSPerl to
create an entry with a date. My web page is prompting the user to enter
a date, which I'm assuming will be in the format mm/dd/yyyy. I am using
the perl module ParseDate to attempt to figure out what they enter. In
any case, I need to convert this user-entered value into some format
that ars_CreateEntry can deal with. My code does this:
($entryId =3D ars_CreateEntry($ctrl, $shopSchema,=20
$sf{"Description"}, $details,
... various fields you don't care about...
$sf{"Date Required"}, "$date1",=20
... more fields...
$sf{"Status"}, "Submitted"))=20
or print "\n<p>[ERROR]\tCould not add shop order due to
$ars_errstr<b><br>\n";
I have tried numerous ways of formatting the date field $date1 above to
attempt to get it to shop up in the proper format in Remedy. I have
tried numerous variations of the following:=20
A string (i.e. "10/17/2007")
An integer (converted via timelocal and others to epoch time)
I either end up with the date 1/1/9999 or 1/1/4713 B.C. in my date
field. I have searched everywhere on the net that I can find and nothing
has helped. Does anyone know what to do to a user-entered date to make
ars_CreateEntry accept it properly?
This is running on a Win2K server with ARSPerl 1.82 against a Remedy 6.0
system on Oracle.
Thanks, Tim
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
CONFIDENTIALITY NOTICE
----------------------
This message, together with any attachments, may be legally privileged
and is confidential information intended only for the use of the
individual or entity to which it is addressed. It is exempt from
disclosure under applicable law including court orders. If you are not
the intended recipient, you are hereby notified that any use,
dissemination, distribution or copy of this message, or any attachment,
is strictly prohibited. If you have received this message in error,
please notify the original sender and delete this message, along with
any attachments, from your computer.
|
|
From: Paizo <pai...@gm...> - 2007-10-17 16:52:40
|
from my experience i can say that date are stored as seconds from 01/01/1970, so i would suggest u to convert the user input into an epoch time http://www.perl.com/pub/a/2003/03/13/datetime.html hope it help 2007/10/17, Pittman, Timothy <Tim...@re...>: > > I have been having considerable difficulty trying to use ARSPerl to > create an entry with a date. My web page is prompting the user to enter > a date, which I'm assuming will be in the format mm/dd/yyyy. I am using > the perl module ParseDate to attempt to figure out what they enter. In > any case, I need to convert this user-entered value into some format > that ars_CreateEntry can deal with. My code does this: > > ($entryId =3D ars_CreateEntry($ctrl, $shopSchema, > $sf{"Description"}, $details, > ... various fields you don't care about... > $sf{"Date Required"}, "$date1", > ... more fields... > $sf{"Status"}, "Submitted")) > or print "\n<p>[ERROR]\tCould not add shop order due to > $ars_errstr<b><br>\n"; > > I have tried numerous ways of formatting the date field $date1 above to > attempt to get it to shop up in the proper format in Remedy. I have > tried numerous variations of the following: > A string (i.e. "10/17/2007") > An integer (converted via timelocal and others to epoch time) > > I either end up with the date 1/1/9999 or 1/1/4713 B.C. in my date > field. I have searched everywhere on the net that I can find and nothing > has helped. Does anyone know what to do to a user-entered date to make > ars_CreateEntry accept it properly? > > This is running on a Win2K server with ARSPerl 1.82 against a Remedy 6.0 > system on Oracle. > > Thanks, Tim > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > CONFIDENTIALITY NOTICE > ---------------------- > This message, together with any attachments, may be legally privileged > and is confidential information intended only for the use of the > individual or entity to which it is addressed. It is exempt from > disclosure under applicable law including court orders. If you are not > the intended recipient, you are hereby notified that any use, > dissemination, distribution or copy of this message, or any attachment, > is strictly prohibited. If you have received this message in error, > please notify the original sender and delete this message, along with > any attachments, from your computer. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Arsperl-users mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-users > --=20 -------------------- A me cugin na volta xe nd=E0 dal geataro e el ga domand=E0 na coppetta trig= usto co i gusti seegheta, sarexe e schie co na fettina de poenta. El geataro pena sentio che=E0 goduriosa scelta, el se ga messo subito el pigiama de banane e el ghe ga messo in testa a corona de poegge medie e lo ga fatto diventare Re dei Gelati Biricchini. ----------------------- Confezione trigusto seegheta/sarexe/chie co pratico contenitore par e fete de poenta, stile estat=E8 o quea dea ciocoeata Altri gusti poe essere bigadini/kiwi/lasonil co socoi de vacca da tociare o erbagatta/straciatella/calsina co coe de sorxe da tociare ------------ Rileggendo a firma diria che se poe puntare al mercato dei ghiaccioli col e= l gusto crema al diserbo e parafl=F9 ricoperta da una soffice crosta de pus c= o al posto del bacheto un termometro anale pratico pa misurarse a freve dopo aver magn=E0 el geato (chi xe che no lo fa al giorno d'oggi?!?!). Garantite scorese bitonali e solfeggi anali. |
|
From: Thilo S. <thi...@ap...> - 2007-10-17 17:03:56
|
Unfortunately, date fields (unlike date/time fields) are only supported
since ARSperl version 1.90
The value has to be an integer which can be computed from an epoch
timestamp by
int( $epoch_time / 86400 ) + 2440588
Regards,
Thilo Stapff
Pittman, Timothy wrote:
> I have been having considerable difficulty trying to use ARSPerl to
> create an entry with a date. My web page is prompting the user to enter
> a date, which I'm assuming will be in the format mm/dd/yyyy. I am using
> the perl module ParseDate to attempt to figure out what they enter. In
> any case, I need to convert this user-entered value into some format
> that ars_CreateEntry can deal with. My code does this:
>
> ($entryId = ars_CreateEntry($ctrl, $shopSchema,
> $sf{"Description"}, $details,
> ... various fields you don't care about...
> $sf{"Date Required"}, "$date1",
> ... more fields...
> $sf{"Status"}, "Submitted"))
> or print "\n<p>[ERROR]\tCould not add shop order due to
> $ars_errstr<b><br>\n";
>
> I have tried numerous ways of formatting the date field $date1 above to
> attempt to get it to shop up in the proper format in Remedy. I have
> tried numerous variations of the following:
> A string (i.e. "10/17/2007")
> An integer (converted via timelocal and others to epoch time)
>
> I either end up with the date 1/1/9999 or 1/1/4713 B.C. in my date
> field. I have searched everywhere on the net that I can find and nothing
> has helped. Does anyone know what to do to a user-entered date to make
> ars_CreateEntry accept it properly?
>
> This is running on a Win2K server with ARSPerl 1.82 against a Remedy 6.0
> system on Oracle.
>
> Thanks, Tim
>
> ========================================================================
> CONFIDENTIALITY NOTICE
> ----------------------
> This message, together with any attachments, may be legally privileged
> and is confidential information intended only for the use of the
> individual or entity to which it is addressed. It is exempt from
> disclosure under applicable law including court orders. If you are not
> the intended recipient, you are hereby notified that any use,
> dissemination, distribution or copy of this message, or any attachment,
> is strictly prohibited. If you have received this message in error,
> please notify the original sender and delete this message, along with
> any attachments, from your computer.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Arsperl-users mailing list
> Ars...@ar...
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
>
|
|
From: Pittman, T. <Tim...@re...> - 2007-10-17 17:38:16
|
Thanks. That worked. I understand where 86400 came from, but what is
the significance of 2440588?
Tim Pittman
Project Engineer
Respironics, Inc.
=20
-----Original Message-----
From: ars...@ar...
[mailto:ars...@ar...] On Behalf Of Thilo Stapff
Sent: Wednesday, October 17, 2007 1:03 PM
To: ARSperl User Discussion
Subject: Re: [Arsperl-users] Inserting a date in ARSPerl
Unfortunately, date fields (unlike date/time fields) are only supported=20
since ARSperl version 1.90
The value has to be an integer which can be computed from an epoch=20
timestamp by
int( $epoch_time / 86400 ) + 2440588
Regards,
Thilo Stapff
Pittman, Timothy wrote:
> I have been having considerable difficulty trying to use ARSPerl to
> create an entry with a date. My web page is prompting the user to
enter
> a date, which I'm assuming will be in the format mm/dd/yyyy. I am
using
> the perl module ParseDate to attempt to figure out what they enter.
In
> any case, I need to convert this user-entered value into some format
> that ars_CreateEntry can deal with. My code does this:
>=20
> ($entryId =3D ars_CreateEntry($ctrl, $shopSchema,=20
> $sf{"Description"}, $details,
> ... various fields you don't care about...
> $sf{"Date Required"}, "$date1",=20
> ... more fields...
> $sf{"Status"}, "Submitted"))=20
> or print "\n<p>[ERROR]\tCould not add shop order due to
> $ars_errstr<b><br>\n";
>=20
> I have tried numerous ways of formatting the date field $date1 above
to
> attempt to get it to shop up in the proper format in Remedy. I have
> tried numerous variations of the following:=20
> A string (i.e. "10/17/2007")
> An integer (converted via timelocal and others to epoch time)
>=20
> I either end up with the date 1/1/9999 or 1/1/4713 B.C. in my date
> field. I have searched everywhere on the net that I can find and
nothing
> has helped. Does anyone know what to do to a user-entered date to make
> ars_CreateEntry accept it properly?
>=20
> This is running on a Win2K server with ARSPerl 1.82 against a Remedy
6.0
> system on Oracle.
>=20
> Thanks, Tim
>=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
CONFIDENTIALITY NOTICE
----------------------
This message, together with any attachments, may be legally privileged
and is confidential information intended only for the use of the
individual or entity to which it is addressed. It is exempt from
disclosure under applicable law including court orders. If you are not
the intended recipient, you are hereby notified that any use,
dissemination, distribution or copy of this message, or any attachment,
is strictly prohibited. If you have received this message in error,
please notify the original sender and delete this message, along with
any attachments, from your computer.
|
|
From: Thilo S. <thi...@ap...> - 2007-10-17 17:54:33
|
The BMC "Form and Application Objects" Guide says:
Users can enter dates from January 1, 4713 B.C. to January 1, 9999 A.D.
2440588 is the difference (in days) between January 1, 1970 AD and
January 1, 4713 BC.
I don't know why they chose 4713 BC as the starting year.
Regards,
Thilo Stapff
Pittman, Timothy wrote:
> Thanks. That worked. I understand where 86400 came from, but what is
> the significance of 2440588?
>
> Tim Pittman
> Project Engineer
> Respironics, Inc.
>
> -----Original Message-----
> From: ars...@ar...
> [mailto:ars...@ar...] On Behalf Of Thilo Stapff
> Sent: Wednesday, October 17, 2007 1:03 PM
> To: ARSperl User Discussion
> Subject: Re: [Arsperl-users] Inserting a date in ARSPerl
>
>
> Unfortunately, date fields (unlike date/time fields) are only supported
> since ARSperl version 1.90
>
> The value has to be an integer which can be computed from an epoch
> timestamp by
>
> int( $epoch_time / 86400 ) + 2440588
>
>
> Regards,
> Thilo Stapff
>
>
> Pittman, Timothy wrote:
>> I have been having considerable difficulty trying to use ARSPerl to
>> create an entry with a date. My web page is prompting the user to
> enter
>> a date, which I'm assuming will be in the format mm/dd/yyyy. I am
> using
>> the perl module ParseDate to attempt to figure out what they enter.
> In
>> any case, I need to convert this user-entered value into some format
>> that ars_CreateEntry can deal with. My code does this:
>>
>> ($entryId = ars_CreateEntry($ctrl, $shopSchema,
>> $sf{"Description"}, $details,
>> ... various fields you don't care about...
>> $sf{"Date Required"}, "$date1",
>> ... more fields...
>> $sf{"Status"}, "Submitted"))
>> or print "\n<p>[ERROR]\tCould not add shop order due to
>> $ars_errstr<b><br>\n";
>>
>> I have tried numerous ways of formatting the date field $date1 above
> to
>> attempt to get it to shop up in the proper format in Remedy. I have
>> tried numerous variations of the following:
>> A string (i.e. "10/17/2007")
>> An integer (converted via timelocal and others to epoch time)
>>
>> I either end up with the date 1/1/9999 or 1/1/4713 B.C. in my date
>> field. I have searched everywhere on the net that I can find and
> nothing
>> has helped. Does anyone know what to do to a user-entered date to make
>> ars_CreateEntry accept it properly?
>>
>> This is running on a Win2K server with ARSPerl 1.82 against a Remedy
> 6.0
>> system on Oracle.
>>
>> Thanks, Tim
>>
>
> ========================================================================
> CONFIDENTIALITY NOTICE
> ----------------------
> This message, together with any attachments, may be legally privileged
> and is confidential information intended only for the use of the
> individual or entity to which it is addressed. It is exempt from
> disclosure under applicable law including court orders. If you are not
> the intended recipient, you are hereby notified that any use,
> dissemination, distribution or copy of this message, or any attachment,
> is strictly prohibited. If you have received this message in error,
> please notify the original sender and delete this message, along with
> any attachments, from your computer.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Arsperl-users mailing list
> Ars...@ar...
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
>
|
|
From: Axton <axt...@gm...> - 2007-10-17 18:14:53
|
"I don't know why they chose 4713 BC as the starting year." http://en.wikipedia.org/wiki/Julian_Period Axton On 10/17/07, Thilo Stapff <thi...@ap...> wrote: > The BMC "Form and Application Objects" Guide says: > > Users can enter dates from January 1, 4713 B.C. to January 1, 9999 A.D. > > > 2440588 is the difference (in days) between January 1, 1970 AD and > January 1, 4713 BC. > I don't know why they chose 4713 BC as the starting year. > > > Regards, > Thilo Stapff > > > Pittman, Timothy wrote: > > Thanks. That worked. I understand where 86400 came from, but what is > > the significance of 2440588? > > > > Tim Pittman > > Project Engineer > > Respironics, Inc. > > > > -----Original Message----- > > From: ars...@ar... > > [mailto:ars...@ar...] On Behalf Of Thilo Stapff > > Sent: Wednesday, October 17, 2007 1:03 PM > > To: ARSperl User Discussion > > Subject: Re: [Arsperl-users] Inserting a date in ARSPerl > > > > > > Unfortunately, date fields (unlike date/time fields) are only supported > > since ARSperl version 1.90 > > > > The value has to be an integer which can be computed from an epoch > > timestamp by > > > > int( $epoch_time / 86400 ) + 2440588 > > > > > > Regards, > > Thilo Stapff > > > > > > Pittman, Timothy wrote: > >> I have been having considerable difficulty trying to use ARSPerl to > >> create an entry with a date. My web page is prompting the user to > > enter > >> a date, which I'm assuming will be in the format mm/dd/yyyy. I am > > using > >> the perl module ParseDate to attempt to figure out what they enter. > > In > >> any case, I need to convert this user-entered value into some format > >> that ars_CreateEntry can deal with. My code does this: > >> > >> ($entryId = ars_CreateEntry($ctrl, $shopSchema, > >> $sf{"Description"}, $details, > >> ... various fields you don't care about... > >> $sf{"Date Required"}, "$date1", > >> ... more fields... > >> $sf{"Status"}, "Submitted")) > >> or print "\n<p>[ERROR]\tCould not add shop order due to > >> $ars_errstr<b><br>\n"; > >> > >> I have tried numerous ways of formatting the date field $date1 above > > to > >> attempt to get it to shop up in the proper format in Remedy. I have > >> tried numerous variations of the following: > >> A string (i.e. "10/17/2007") > >> An integer (converted via timelocal and others to epoch time) > >> > >> I either end up with the date 1/1/9999 or 1/1/4713 B.C. in my date > >> field. I have searched everywhere on the net that I can find and > > nothing > >> has helped. Does anyone know what to do to a user-entered date to make > >> ars_CreateEntry accept it properly? > >> > >> This is running on a Win2K server with ARSPerl 1.82 against a Remedy > > 6.0 > >> system on Oracle. > >> > >> Thanks, Tim > >> > > > > ======================================================================== > > CONFIDENTIALITY NOTICE > > ---------------------- > > This message, together with any attachments, may be legally privileged > > and is confidential information intended only for the use of the > > individual or entity to which it is addressed. It is exempt from > > disclosure under applicable law including court orders. If you are not > > the intended recipient, you are hereby notified that any use, > > dissemination, distribution or copy of this message, or any attachment, > > is strictly prohibited. If you have received this message in error, > > please notify the original sender and delete this message, along with > > any attachments, from your computer. > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Arsperl-users mailing list > > Ars...@ar... > > https://lists.sourceforge.net/lists/listinfo/arsperl-users > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Arsperl-users mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-users > |