如何在文件创建日期之间进行插值?

时间:2019-04-07 13:07:15

标签: c# interpolation

我有一个GoPro Hero4。手表芯片似乎坏了。 每次电池电量完全耗尽时,时钟会自行将其设置为约。 2015年1月1日00:00:00。

如果看到此信息,我将应用再次设置为当前时间 时间。

现在,我有以下格式的文件

GOPRXXXX,而XXXX是四位数。

GOPR2270.LRV  25.03.2019 13:01
GOPR2270.MP4  25.03.2019 13:01
GOPR2270.THM  25.03.2019 13:02
GOPR2271.LRV  25.03.2019 13:36
GOPR2271.MP4  25.03.2019 13:36
GOPR2272.LRV  31.12.2014 23:01
GOPR2272.MP4  31.12.2014 23:01
GOPR2272.THM  31.12.2014 23:10
GOPR2273.LRV  01.01.2015 00:20
GOPR2273.MP4  01.01.2015 00:20
GOPR2273.THM  01.01.2015 00:20
GOPR2274.LRV  28.03.2019 13:36

这里是正确的文件创建时间

GOPR2270.LRV  25.03.19 13:01
GOPR2270.MP4  25.03.19 13:01
GOPR2270.THM  25.03.19 13:02
GOPR2271.LRV  25.03.19 13:36
GOPR2271.MP4  25.03.19 13:36
...
GOPR2274.LRV  28.03.19 13:36

查看代码以了解我的想法。

List<Datumsobjekt> ldo = new List<Datumsobjekt>();
//Loop through files
{

  if (filename.Contains("GOPR") &&
      filename.Contains("MP4"))
  {
      Datumsobjekt d = new Datumsobjekt();
      d.filenamename = filename;
      d.creationtime = File.GetCreationTime(filename);
      ldo.add(d);
      Console.WriteLine(Path.GetFileName(filename) + ";" + File.GetCreationTime(filename).ToShortDateString() + " " + File.GetCreationTime(filename).ToShortTimeString());
  }
}

//work with ldo
  //find files between all dates that are around 01.01.2015
  //find those that are not around them
  //get time distance between lowest and highest date
  //divide by number of files in between
  //assign to each file the appropriate date and time in between ordered by increasing file name number.



....

public class Datumsobjekt
{
    public string filename { get; set; }
    public DateTime creationtime { get; set; }
}

我的目标是在时间之间进行插值,并将之间的每个文件设置为dd.mm.yyyy hh:ss中的新创建日期。

GOPR2270.LRV  25.03.19 13:01
GOPR2270.MP4  25.03.19 13:01
GOPR2270.THM  25.03.19 13:02
GOPR2271.LRV  25.03.19 13:36
GOPR2271.MP4  25.03.19 13:36
GOPR2272.LRV  26.03.19 ??:??
GOPR2272.MP4  26.03.19 ??:??
GOPR2272.THM  26.03.19 ??:??
GOPR2273.LRV  27.03.19 ??:??
GOPR2273.MP4  27.03.19 ??:??
GOPR2273.THM  27.03.19 ??:??
GOPR2274.LRV  28.03.19 13:36

0 个答案:

没有答案
相关问题