Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
d3e70ab4
Commit
d3e70ab4
authored
Dec 13, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Time formats for time in filenames
parent
bc280088
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
src/lib/co/src/co_time.c
src/lib/co/src/co_time.c
+13
-3
src/lib/co/src/co_time.h
src/lib/co/src/co_time.h
+3
-1
No files found.
src/lib/co/src/co_time.c
View file @
d3e70ab4
...
...
@@ -541,10 +541,16 @@ time_AtoAscii (
return
TIME__RANGE
;
sprintf
(
tmpStr
,
".%02d"
,
(
int
)(
tp
->
tv_nsec
/
10000000
));
buflen
=
strlen
(
buf
);
if
(
strlen
(
tmpStr
)
+
buflen
<
(
unsigned
int
)
bufsize
)
strcpy
(
&
buf
[
buflen
],
tmpStr
);
switch
(
format
)
{
case
time_eFormat_FileDateAndTime
:
case
time_eFormat_FileDate
:
break
;
default:
sprintf
(
tmpStr
,
".%02d"
,
(
int
)(
tp
->
tv_nsec
/
10000000
));
if
(
strlen
(
tmpStr
)
+
buflen
<
(
unsigned
int
)
bufsize
)
strcpy
(
&
buf
[
buflen
],
tmpStr
);
}
return
TIME__SUCCESS
;
}
...
...
@@ -678,6 +684,10 @@ time_TmToAscii (
strftime
(
buf
,
bufsize
,
"%d-%b-%Y %H:%M:%S"
,
tmptr
);
for
(
i
=
3
;
i
<
6
;
i
++
)
buf
[
i
]
=
toupper
(
buf
[
i
]);
}
else
if
(
format
==
time_eFormat_FileDateAndTime
)
{
strftime
(
buf
,
bufsize
,
"%Y%m%d_%H%M%S"
,
tmptr
);
}
else
if
(
format
==
time_eFormat_FileDate
)
{
strftime
(
buf
,
bufsize
,
"%Y%m%d"
,
tmptr
);
}
else
if
(
format
==
time_eFormat_ComprDateAndTime
)
{
strftime
(
buf
,
bufsize
,
"%y-%m-%d %H:%M:%S"
,
tmptr
);
}
else
if
(
format
==
time_eFormat_NumDateAndTime
)
{
...
...
src/lib/co/src/co_time.h
View file @
d3e70ab4
...
...
@@ -87,7 +87,9 @@ typedef enum {
time_eFormat_DateAndTime
=
0
,
//!< Display date and time, 01-JAN-1970 01:00:00.00
time_eFormat_Time
=
1
,
//!< Display time only 01:00:00.00
time_eFormat_ComprDateAndTime
=
2
,
//!< Date and time compressed format, 70-01-01 00:00:00
time_eFormat_NumDateAndTime
=
3
//!< Date and time format, 2005-01-01 00:00:00
time_eFormat_NumDateAndTime
=
3
,
//!< Date and time format, 2005-01-01 00:00:00
time_eFormat_FileDateAndTime
=
4
,
//!< Date and time format, 20050101_000000
time_eFormat_FileDate
=
5
//!< Date format, 20050101
}
time_eFormat
;
typedef
enum
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment