Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 162659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:25:49+00:00 2026-05-11T11:25:49+00:00

I am implemening simple file-sharing service. Currently I use a file-based database (as it

  • 0

I am implemening simple file-sharing service. Currently I use a file-based database (as it suits my needs).

   # somewhere in my cgi script    sub first_run     {       my $dbh = DBI->connect('dbi:DBM:');       $dbh = DBI->connect('dbi:DBM:', '', '',{ AutoCommit => 1, RaiseError => 1, f_dir=>$DATABASE_DIR} );       unless ($dbh)       {         print '<br>Cannot connect: $DBI::errstr';         return undef;       }       $dbh->do('CREATE TABLE uploads( user_name TEXT,         file_name TEXT,          upload_date TEXT ) ');       $dbh->disconnect( );     } 

As you can see I propose to store the upload timestamp as a string, since currently I only have to display it (suppose to use localtime() to get timestamp in a human readable format). But this seems to me somewhat bad. What if later I’ll want to show uploads from some period, etc.

What is the common way of storing timestamps in a DBM database without using third-party, CPAN modules? How can I pull them later and show them to the user (in my situation, convert back to string)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:25:50+00:00Added an answer on May 11, 2026 at 11:25 am

    Consider that storing UTC time is less ambiguous than storing local time. If you save a time at your computer in London and send me the file in Hong Kong, will I when I load the file in your program see the time you actually saved?

    Consider that in storing UTC time you have (at least) two choices: the formatted time string, or a count of numbers of (seconds/milliseconds/whatever) since a particular time (‘the epoch’). Presumably either format is isomorphic with the other, as there is a well-defined bi-directional conversion rom one to the other.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer There is an API in Microsoft's developer center, but it… May 11, 2026 at 12:35 pm
  • added an answer If you are using Powershell V2 or later, you can… May 11, 2026 at 12:35 pm
  • added an answer db.GetChangeSet().Inserts May 11, 2026 at 12:35 pm

Related Questions

I am implementing a very simple file database. I have 2 basic operations: void
I am implementing a quite simple state-machine order processing application. It is a e-commerce
I am implementing a design that uses custom styled submit-buttons. They are quite simply
I am implementing a HttpRequestValidationException in my Application_Error Handler, and if possible, I want
I am implementing exception handling for our BizTalk services, and have run into a
What is the most preferred format of unicode strings in memory when they are
This is intended to be a lightweight generic solution, although the problem is currently
I have a microcontroller that must download a large file from a PC serial
I’m looking at rewriting a portion of our application in C# (currently legacy VB6

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.