I need to pickup the system date in the form. How do I do this ?
May 16, 2000, 6:43 PM
Veteran (17240 posts)
May 16, 2000, 6:43 PM
Post #2 of 13
Views: 2904
You should set your date field in the default.cfg file to the following:
Now...if you want to print this value in the add, modify, and delete forms, simply add the following hidden field in the sub html_record_form routine, so that users cannot modify it, but admin can:
print qq|<input type="text" name="Date" value="$rec{'Date'}">|;
}
else {
print qq|<input type="hidden" name="Date" value="$rec{'Date'}">$rec{'Date'}|;
}Regards,
Eliot Lee
Anthro TECH, L.L.C
Web: http://www.anthrotech.com/
Code:
Date => [1, 'date', 12, 15, 1, &get_date, ''],Code:
if ($per_admin) { print qq|<input type="text" name="Date" value="$rec{'Date'}">|;
}
else {
print qq|<input type="hidden" name="Date" value="$rec{'Date'}">$rec{'Date'}|;
}
Eliot Lee
Anthro TECH, L.L.C
Web: http://www.anthrotech.com/
May 16, 2000, 7:37 PM
Veteran (17240 posts)
May 16, 2000, 7:37 PM
Post #4 of 13
Views: 2905
There is a Date.pm module at http://cpan.org that you can replace for the Local.pm module called in the sub date_to_unix routine in the db.cgi file.
Also, webmaster33 (a LINKS user), is working on a new International date module for LINKS that could be adapted to DBMAN.
Regards,
Eliot Lee
Anthro TECH, L.L.C
Web: http://www.anthrotech.com/
Also, webmaster33 (a LINKS user), is working on a new International date module for LINKS that could be adapted to DBMAN.
Regards,
Eliot Lee
Anthro TECH, L.L.C
Web: http://www.anthrotech.com/
May 16, 2000, 9:37 PM
Veteran (17240 posts)
May 16, 2000, 9:37 PM
Post #8 of 13
Views: 2892
JPDeni wrote some data modifications awhile back and I believe they are posted in the Resource Center. If they do not help you, let us know and we can try to help you re-configure the time.
BTW: There is a time hack for LINKS in the FAQs in the Resource Center for LINKS that may help you.
Regards,
Eliot Lee
Anthro TECH, L.L.C
Web: http://www.anthrotech.com/
BTW: There is a time hack for LINKS in the FAQs in the Resource Center for LINKS that may help you.
Regards,
Eliot Lee
Anthro TECH, L.L.C
Web: http://www.anthrotech.com/
May 17, 2000, 2:38 AM
Veteran / Moderator (8669 posts)
May 17, 2000, 2:38 AM
Post #9 of 13
Views: 2887
My date mod won't work for this.
Miheer, if your server returns GMT from the time() function, you would need to add 19800 to get GMT+5:30.
For example, to change the time returned from sub get_time, change
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time());
to
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time() + 19800);
JPD
Miheer, if your server returns GMT from the time() function, you would need to add 19800 to get GMT+5:30.
For example, to change the time returned from sub get_time, change
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time());
to
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time() + 19800);
JPD
May 17, 2000, 6:43 AM
User (66 posts)
May 17, 2000, 6:43 AM
Post #10 of 13
Views: 2866
J P Deni, Greetings !
I do not understand much about Perl but I generally give a TRY and GO with help from nice and helpful people like you and more often then not succed.
When I do Telnet and give "date" command the server returns me like this
Wed May 17 06:31:24 PDT 2000
Now, I am located in India and it is 7:00PM or 19:00:00 hrs. now.
My server is located in USA. Can you figure out anything ?
Regards
Vijay
I do not understand much about Perl but I generally give a TRY and GO with help from nice and helpful people like you and more often then not succed.
When I do Telnet and give "date" command the server returns me like this
Wed May 17 06:31:24 PDT 2000
Now, I am located in India and it is 7:00PM or 19:00:00 hrs. now.
My server is located in USA. Can you figure out anything ?
Regards
Vijay
May 17, 2000, 4:45 PM
Veteran / Moderator (8669 posts)
May 17, 2000, 4:45 PM
Post #11 of 13
Views: 2857
The date things are always hard for me to figure out.
I'm pretty sure that you can use
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time() + 45000);
in sub get_time.
The 45000 is the number of seconds that your time differs from your server's time -- 12 and a half hours.
If this works for you, be aware that you will have to make a change to this at the end of October, when we in the US go back to regular time instead of "daylight savings time." I'm not even sure right now which way it would go. You'll have to either add or subtract 3600 from the 45000.
JPD
I'm pretty sure that you can use
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time() + 45000);
in sub get_time.
The 45000 is the number of seconds that your time differs from your server's time -- 12 and a half hours.
If this works for you, be aware that you will have to make a change to this at the end of October, when we in the US go back to regular time instead of "daylight savings time." I'm not even sure right now which way it would go. You'll have to either add or subtract 3600 from the 45000.
JPD