
先用一个 标签 获取原来网站的发布时间,在建一个time标签,对获取到的那个标签,数据处理就好了,然后在发布模块增加字段 dateline字段,
火车头发布参考文章:https://www.lecms.cc/index.php?thread-55.htm

代码如下
using System;
using System.Collections.Generic;
using SpiderInterface;
class LocoyCode{
/// <summary>
/// 执行方法,不能修改类和方法名称。
/// </summary>
/// <param name="content">标签内容</param>
/// <param name="response">页面响应,包含了Url、原始Html等属性</param>
/// <returns>返回处理后的标签内容</returns>
public string Run(string content,ResponseEntry response){
// 在这里编写处理代码
string dt = "yyyy-MM-dd";
DateTime time = DateTime.ParseExact(content, dt, System.Globalization.CultureInfo.CurrentCulture);
DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
// 这里除10000000将时间戳调整为10位,如果要保留13位,那么将 10000000 改为 10000
long t = (time.Ticks - startTime.Ticks) / 10000000;
content = t.ToString();
return content;
}
}
本文关键词:
时间
火车头
采集
网站
转为
lecms
希望以上内容对你有所帮助!如果还有其他问题,请随时提问。
各类知识收集 拥有多年CMS企业建站经验,对
iCMS,
LeCMS,
ClassCMS,
Fastadmin,
PbootCMS,
PHPCMS,
易优CMS,
YzmCMS,
讯睿CMS,
极致CMS,
Wordpress,
HkCMS,
YznCMS,
WellCMS,
ThinkCMF,
等各类cms的相互转化,程序开发,网站制作,bug修复,程序杀毒,插件定制都可以提供最佳解决方案。