Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

date/time format from pdb file

4 views
Skip to first unread message

pdco...@blueyonder.co.uk

unread,
Dec 6, 2008, 7:01:20 AM12/6/08
to
Im trying to write a little (perl) script extract data from a pdb
file

http://www.jsankey.com/software/timesheet/timesheet.htm FWIW

ive got to each data field in each record

foreach my $k (@{$pdb->{"records"}})
{
foreach $key ( keys %$k )
{ print "key is $key: => $$k{$key} \n " ;}
}

there are 2 date/time fields and a text field
i can strip off the free text entry as $2
$str=~/(.+)ÿÿ(.+)/;

i cant find anything on how the date/time will be saved ( and how the
entries will be divided in the string $1)

Can anyone enlighten me - or point me to resource to convert from pdb
date format to something human-readable ?

pdco...@blueyonder.co.uk

unread,
Dec 6, 2008, 8:27:44 AM12/6/08
to
95 b1 b0 00 03 02 0d 00 02 03 b1 00 0b 03 c0 ff ff 50 68 6f 6e 65
20 43 61 6c 6c

is the hexdump that will contain a2 date/times .
The text after the ff ff is 'phone call '

ne...@picaxe.us

unread,
Dec 6, 2008, 12:08:48 PM12/6/08
to
On Sat, 6 Dec 2008 04:01:20 -0800 (PST), pdco...@blueyonder.co.uk
wrote:

>Im trying to write a little (perl) script extract data from a pdb
>file
>
>http://www.jsankey.com/software/timesheet/timesheet.htm FWIW
>
>ive got to each data field in each record
>
>foreach my $k (@{$pdb->{"records"}})
>{
>foreach $key ( keys %$k )
> { print "key is $key: => $$k{$key} \n " ;}
>}
>
>there are 2 date/time fields and a text field
>i can strip off the free text entry as $2

> $str=~/(.+)яя(.+)/;


>
>i cant find anything on how the date/time will be saved ( and how the
>entries will be divided in the string $1)
>
>Can anyone enlighten me - or point me to resource to convert from pdb
>date format to something human-readable ?

One format is a long integer with the year *10000 + the month * 100 +
the day of the month (from memory, YMMV).

Depending on what program created the pdb, you might find pdbconverter
useful: http://pdb-converter.en.softonic.com/palm
It can read most pdb files.

If it can't read your file, try the trial of pdbconverter pro:
http://www.mverive.com/pdbconverter.htm

John

pdco...@blueyonder.co.uk

unread,
Dec 6, 2008, 1:04:51 PM12/6/08
to
On Dec 6, 5:08 pm, n...@picaxe.us wrote:
> On Sat, 6 Dec 2008 04:01:20 -0800 (PST), pdcoo...@blueyonder.co.uk

> wrote:
>
>
>
> >Im trying to write a little (perl) script  extract data from a pdb
> >file
>
> >http://www.jsankey.com/software/timesheet/timesheet.htmFWIW
>
> >ive got to each data field in each record
>
> >foreach my $k (@{$pdb->{"records"}})
> >{
> >foreach     $key   (   keys     %$k   )
> >    { print "key is $key:  => $$k{$key} \n " ;}
> >}
>
> >there are 2 date/time  fields and a text field
> >i can strip off the  free text entry  as $2
> > $str=~/(.+)ÿÿ(.+)/;

>
> >i cant find anything on how the date/time will be saved ( and how the
> >entries will be divided in  the string $1)
>
> >Can anyone enlighten me  - or point me to resource to convert from pdb
> >date format to something human-readable ?
>
> One format is a long integer with the year *10000 + the month * 100 +
> the day of the month (from memory, YMMV).
>
> Depending on what program created the pdb, you might find pdbconverter
> useful:http://pdb-converter.en.softonic.com/palm
> It can read most pdb files.
>
> If it can't read your file, try the trial of pdbconverter pro:http://www.mverive.com/pdbconverter.htm
>
> John

i read somewhere that its year -1904 + 100*m +d
so it either
1 Dec 2008 = 2008*10000+12*100+1= 20081201 =&1326A31
or (2008-1900)*10000+12*100+1=1081201 =&107F71
or (2008-1904)*10000+12*100+1=1041201=&FE331

hexdump

p h o n e c a l l
95 b1 00 03 02 0d 00 02 03 b1 00 0b 03 c0 ff ff 50 68 6f 6e 65 20 43
61 6c 6c

id like to end up with the perl script doing all the conversion ,
automatically if possible

ne...@picaxe.us

unread,
Dec 6, 2008, 8:18:35 PM12/6/08
to
On Sat, 6 Dec 2008 10:04:51 -0800 (PST), pdco...@blueyonder.co.uk
wrote:

That sounds like Mac time format.

>hexdump
>
>p h o n e c a l l
>95 b1 00 03 02 0d 00 02 03 b1 00 0b 03 c0 ff ff 50 68 6f 6e 65 20 43
>61 6c 6c
>
>id like to end up with the perl script doing all the conversion ,
>automatically if possible

What is the actual date/time for the entry in hex?

The date/time seems to precede the text:
50 68 6f 6e 65 20 43 61 6c 6c is
P h o n e (sp) C a l l

with 20 being the space character

See http://www.asciitable.com/

John

0 new messages