Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Conversion of LastModified method

Conversion of LastModified method

Scheduled Pinned Locked Moved C#
csharphelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amatista
    wrote on last edited by
    #1

    Hallo, I have a problem I use Lucene.Net and the method of IndexReader LastModified returns long, which means the number of seconds from Jan. 1, 1970(or another year, I am not so sure). I know there is a function for the conversion, but just do not know which one. Does anyone here have any idea? Here is the signature of the above-mentioned method: public static long LastModified(string directory) Thanks in advance! Amatisa

    J 1 Reply Last reply
    0
    • A Amatista

      Hallo, I have a problem I use Lucene.Net and the method of IndexReader LastModified returns long, which means the number of seconds from Jan. 1, 1970(or another year, I am not so sure). I know there is a function for the conversion, but just do not know which one. Does anyone here have any idea? Here is the signature of the above-mentioned method: public static long LastModified(string directory) Thanks in advance! Amatisa

      J Offline
      J Offline
      Jupiter9
      wrote on last edited by
      #2

      If the return value is a long, then it's probably the date value in ticks. You can convert it to a DateTime object via: DateTime dt = new DateTime(LastModified(directory));

      A 1 Reply Last reply
      0
      • J Jupiter9

        If the return value is a long, then it's probably the date value in ticks. You can convert it to a DateTime object via: DateTime dt = new DateTime(LastModified(directory));

        A Offline
        A Offline
        Amatista
        wrote on last edited by
        #3

        Thank you very much. I have found the solution, but a bit different to your suggestions. I have just tried your suggestion but it didn't work. The problem lies in the returned value LastModified from IndexReader of Lucene.Net, which is the number of millisenconds from 1970.01.01.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups