帮助将朱利安日期转换为常规日期 [英] Help Convert Julian Date to regular date

查看:130
本文介绍了帮助将朱利安日期转换为常规日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,我正在学习,因为我一直在学习;我试图将朱利安日期转换为常规日期MM-DD-YY;我在条件下的查询屏幕中尝试了以下代码。

展开 | 选择 | Wrap | 行号

解决方案

可能有一个函数可以为你转换它但我不知道。


所以

我熟悉Julian的格式日期是4位数,前3位是年份的日期编号,最后一位是该年份的最后一位数字。因此,您必须知道日期所在的十年。


所以要自己转换它你需要计算年份

我将假设日期是在十年01/01/2000 - 31/12 / 2009年

这意味着十年开始的一年是2000

我还假设Julian日期是字符串类型


所以今年是
2000 + cint(右(JulianDte,1))

和日期是01/01 / CalculatedYear +(The3DigitJulianDay-1)

>

完整的陈述类似于


cdate(" 01/01 /"& cstr(2000 + cint)(右(JulianDte, 1))))+ cint(左(JulianDte,3)-1)


其中JulianDate是Julian Date字段的字段名称

和当然你可以添加日期格式位如果你想要


我希望我有足够的括号,我希望它有帮助


Widipedia通知Julian Date,在计算机科学中使用的是序数日期,日期为yyyy-ddd,其中ddd是一年中的日期数,值为1到365(如果是闰年则为366)。


验证yyyy是一个数值(可能在1900和Now()之间)并且ddd是数字和1-366 ,那么日期是

展开 | 选择 | Wrap | 行号


感谢Delerna和OldBirdMan的快速回复。


以下是我试图转换的日期样本


81105

120505

102901

71894


字段名称为[TOBIDE];数据类型是数字。并且字段大小设置为十进制。 (我曾尝试将数据类型更改为日期/时间 - 每次运行下面的查询时都会收到错误消息,说明它是运行的磁盘空间)


CDate(格式( ((则DateValue(QUOT; 01/01 /" + LTRIM(STR(1900 + INT([TOBIDE] / 1000))))+ [TOBIDE] -Int([TOBIDE] / 1000)* 1000)) - 1, mm-dd-yy))


它刚刚结束并没有带来任何结果;但是一旦我从Criteria中取出查询,就会返回上面列出的julian日期???


我需要将这些日期变成MM-DD-YY

I am new to access and I am learning as I go along; I am attempting to convert Julian dates to regular dates "MM-DD-YY"; I have tried the code below in the Query screen under criteria.

Expand|Select|Wrap|Line Numbers

解决方案

There may be a function that will convert it for you but I don''t know it.

So
The format that I am familiar with for Julian date is 4 digits the first 3 is the day number of the year and the last is the last digit in the year. Therefore you must know the decade that the date falls within.

So to convert it yourself you need to calculate the year
I will assume the date is in the decade 01/01/2000 - 31/12/2009
which means the decade start year is 2000
I also assume the Julian date is of type string

so the year is
2000 + cint(right(JulianDte,1))
and the date is 01/01/CalculatedYear + (The3DigitJulianDay-1)


The complete statement would be something like

cdate("01/01/" & cstr(2000 + cint(right(JulianDte,1)) )) + cint(left(JulianDte,3)-1)

Where JulianDate is the field name of the Julian Date field
and of course you can add the date format bit in if you want

I hope I got enough brackets there and I hope it helps


Widipedia informs that Julian Date, as used in Computer Science is Ordinal Date, a date as yyyy-ddd where ddd is the day number for the year, with values from 1 to 365 (366 if leap year).

After verifying that yyyy is a numeric value (probably between 1900 and Now() ) and that ddd is numeric and 1-366, then the date is

Expand|Select|Wrap|Line Numbers


Thank you Delerna and OldBirdMan for the prompt reply.

The following are samples of the dates I am attempting to convert

81105
120505
102901
71894

The field name is [TOBIDE]; the Data Type is "Number" and the field size is set to "Decimal" (I have tried to change the data type to Date/Time - Keep getting error messages saying it''s run of disk space) everytime I run the query below

CDate(Format(((DateValue("01/01/"+LTrim(Str(1900+Int([TOBIDE]/1000))))+[TOBIDE]-Int([TOBIDE]/1000)*1000))-1,"mm-dd-yy"))

It just falls over does not bring any results in the table; but once I take the query out from the Criteria it returns the julian dates listed above???

I need to get these dates into "MM-DD-YY"


这篇关于帮助将朱利安日期转换为常规日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆