$field_ids[3] contains just the field id itself. The value of the field is in $entry{$field_id[3]}}.
You should also note that gmtime returns the month as numbers 0..11 instead of 1..12. Anyway, an easier (and problably more reliable) method for date formatting would be to use a module from CPAN (e.g. Date::Format). Regards, Thilo Paizo wrote: > i tried the following: > > > foreach my $entry_id (sort keys %entries) { > my %entry = ars_GetEntry($ctrl, $ARSschema, $entry_id, @field_ids); > > print "$field_ids[3]\n";# test: print number 3 the first clicle then > nothing > > ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = > gmtime($field_ids[3]); > > $year += 1900; > $mon += 1; > > if ($mday < 10) { > $timestamp_a = "0".$mday.q{/}; > } else { > $timestamp_a = $mday.q{/}; > } > > if ($mon < 10) { > $timestamp_a .= "0".$mon.q{/}.$year." "; > } else { > $timestamp_a .= $mon.q{/}.$year." "; > } > > if ($hour < 10) { > $timestamp_a .= "0".$hour."."; > } else { > $timestamp_a .= $hour."."; > } > > if ($min < 10) { > $timestamp_a .= "0".$min."."; > } else { > $timestamp_a .= $min."."; > } > > if ($sec < 10) { > $timestamp_a .= "0".$sec; > } else { > $timestamp_a .= $sec; > } > > print "$timestamp_a\n\n"; #test: print 01/01/1970 00.00.03 in the > first cile then always 01/01/1970 00.00.00 > > $field_ids[3] = $timestamp_a; > print datafile join("|", @[EMAIL PROTECTED] ) . "\n"; > > } > > > hope its more clear. > > > > 2007/8/2, Clayton Scott <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>>: > > On 8/2/07, Paizo <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > i have another ( stupid question, still new to perl :| ) , if > inside the the > > loop: > > [ loop snipped ] > > i want to convert some dates that are in seconds since 1970 to > something > > like dd/mm/yyyy hh.mm.ss > > if i try to read $field_ids[3] and always get "3" instead of the real > > content :/ > > what i miss? > > Without more code, and data I really can't tell. > > If you want the value for a field in the form you more likely want to > use the entry hash: > > $entry{'field_id'} > > If you want to inspect these data structures you can use the > Data::Dumper module. > > use Data::Dumper; > .... > > print Dumper [EMAIL PROTECTED]; > > foreach my $entry_id (sort keys %entries) { > my %entry = ars_GetEntry($ctrl, $ARSschema, $entry_id, @field_ids); > print Dumper \%entry; > print datafile join("|", @[EMAIL PROTECTED] ) . "\n"; > } > > -- > > Clayton Scott > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > ------------------------------------------------------------------------- > 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 > Arsperl-users@arsperl.org <mailto:Arsperl-users@arsperl.org> > https://lists.sourceforge.net/lists/listinfo/arsperl-users > > > > > -- > -------------------- > A me cugin na volta xe ndà dal geataro e el ga domandà na coppetta > trigusto co i gusti seegheta, sarexe e schie co na fettina de poenta. > El geataro pena sentio cheà 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è 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 el gusto crema al diserbo e paraflù ricoperta da una soffice crosta > de pus co al posto del bacheto un termometro anale pratico pa misurarse > a freve dopo aver magnà el geato (chi xe che no lo fa al giorno > d'oggi?!?!). Garantite scorese bitonali e solfeggi anali. > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > 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 > Arsperl-users@arsperl.org > 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 Arsperl-users@arsperl.org https://lists.sourceforge.net/lists/listinfo/arsperl-users