Hi
You could just store the date as a time number. Many programing
languages deal with a value of time based on the number of seconds since
1.1.1970.
I just tried a test in perl and if you give it a negative value it will
return you dates before 1970 and if the negative number of seconds is
high enough you get negative years. It could be stored in a database as
a simple signed integer and thus very easy to do ordering and
comparisons based on the number.
These time values can then be easily converted into actual dates or
simply year values for display in webpages. Parsing of the year values
could very easily allow for displaying -125 as 125BC, etc.
Just a thought :-)
Joe
######### Simple test in perl ##################
#!/usr/bin/perl -w
use Time::Local;
$now = time();
print "Now: seconds:$now date:\t";
($sec,$min,$hour,$mday,$mon,$year)=localtime($now);
printf "%4d-%02d-%02d %02d:%02d:%02d\n",
$year+1900,$mon+1,$mday,$hour,$min,$sec;
$ay = $year+1900;
$by = $ay * (-1);
if ($ay > 0)
{print "$ay AD\n";}
else
{print "$by BC\n";}
$then = -1000000000;
print "Then: seconds:$then date:\t";
($sec,$min,$hour,$mday,$mon,$year)=localtime($then);
printf "%4d-%02d-%02d %02d:%02d:%02d\n",
$year+1900,$mon+1,$mday,$hour,$min,$sec;
$ay = $year+1900;
$by = $ay * (-1);
if ($ay > 0)
{print "$ay AD\n";}
else
{print "$by BC\n";}
$bc = -100000000000;
print "BC: seconds:$bc date:\t";
($sec,$min,$hour,$mday,$mon,$year)=localtime($bc);
printf "%4d-%02d-%02d %02d:%02d:%02d\n",
$year+1900,$mon+1,$mday,$hour,$min,$sec;
$ay = $year+1900;
$by = $ay * (-1);
if ($ay > 0)
{print "$ay AD\n";}
else
{print "$by BC\n";}
######################################
##Prints out something like:
#
# Now: seconds:1254476703 date: 2009-10-02 10:45:03
# 2009 AD
# Then: seconds:-1000000000 date: 1938-04-24 23:13:20
# 1938 AD
# BC: seconds:-100000000000 date: -1199-02-15 14:12:05
# 1199 BC
#######################################
Tom Jenkins wrote:
> Hi all,
> Just wondering if anyone knew if there was an accepted standard way of
> storing BC dates in collection databases so they're searchable online.
> Putting negative dates seems the most obvious to me, but perhaps this is
> frowned upon... I know the British Museum have BC objects online; anyone
> there or anywhere else care to share their thoughts?
>
> Many thanks
> Tom
>
>
> ---
> Tom Jenkins
> Online Collections, Wolverhampton Art Gallery
>
>
> ------------------------------------------------------------------------------
> DISCLAIMER: This email and files transmitted are
> confidential and are intended solely for the use of the
> intended recipient. If you are not the intended
> recipient, or the person responsible for delivering it to
> the intended recipient, you may not copy, disclose,
> distribute or use it in any unauthorised manner. If you
> have received this email in error please notify us by
> email to [log in to unmask] and then delete
> it and any attachments accompanying it. Please note that
> Wolverhampton City Council cannot guarantee that this
> message or any attachments are virus free or have not been
> intercepted and amended.
> Any views or opinions expressed within this email are
> those of the author and may not necessarily reflect those
> of Wolverhampton City Council and no contractual
> arrangement is intended to arise from this communication.
> ==============================================================================
>
> ****************************************************************
> For mcg information visit the mcg website at
> http://www.museumscomputergroup.org.uk
> To manage your subscription to this email list visit
> http://www.museumscomputergroup.org.uk/email.shtml
> ****************************************************************
>
>
--
Joseph Padfield, [log in to unmask],
Tel: +44 (0)20 7747 2553 Fax: +44 (0)20 7839 3897 Conservation Scientist, Scientific Department, The National Gallery, Trafalgar Square, London, WC2N 5DN
http://cima.ng-london.org.uk
****************************************************************
For mcg information visit the mcg website at
http://www.museumscomputergroup.org.uk
To manage your subscription to this email list visit
http://www.museumscomputergroup.org.uk/email.shtml
****************************************************************
|