hi can anybody tell me how to convert date vector classified char class in to date data type?

1 次查看(过去 30 天)
and i have one column for date and time do i need to split it for the processing i have converted the date from UTC format to GMT. looking for positive response.
  1 个评论
Guillaume
Guillaume 2016-9-28
Please, give an example of your input and what you want as an output.
I have no idea if your input is a date vector or date string (char) and there is no date data type in matlab, there is date string, date number, date vector, and datetime.

请先登录,再进行评论。

回答(2 个)

naadiya khudabux
naadiya khudabux 2016-9-28
编辑:naadiya khudabux 2016-9-28
if true
% code
at the workplace my date variable is seem string variable.
i have tried datevec function and go this error
(>> datevec(RequestTime)
Error using datevec (line 212)
Failed to lookup month of year.
end
if true
% code
for datenum ()
>> datenum(RequestTime)
Error using datenum (line 178)
DATENUM failed.
Caused by:
Error using datevec (line 212)
Failed to lookup month of a year.
>> DateTime(RequestTime) Error using DateTime (line 598) Could not recognize the format of the date/time strings. You can specify a format string using the 'InputFormat' parameter. If the strings contain day, month, or time zone names in a language foreign to the 'en_US' locale, those might not be recognized. You can specify a different locale using the 'Locale' parameter.
end

naadiya khudabux
naadiya khudabux 2016-9-28
i become able to manage it somehow but the i want it in one column vector . i have tried squeeze function

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by