@@ -174,15 +174,6 @@ pub fn now() -> Tm {
174
174
at ( get_time ( ) )
175
175
}
176
176
177
- /// Parses the time from the string according to the format string.
178
- pub fn strptime ( s : & str , format : & str ) -> Result < Tm , ~str > {
179
- do_strptime ( s, format)
180
- }
181
-
182
- /// Formats the time according to the format string.
183
- pub fn strftime ( format : & str , tm : & Tm ) -> ~str {
184
- do_strftime ( format, tm)
185
- }
186
177
187
178
impl Tm {
188
179
/// Convert time to the seconds from January 1, 1970
@@ -264,7 +255,8 @@ impl Tm {
264
255
}
265
256
}
266
257
267
- fn do_strptime ( s : & str , format : & str ) -> Result < Tm , ~str > {
258
+ /// Parses the time from the string according to the format string.
259
+ pub fn strptime ( s : & str , format : & str ) -> Result < Tm , ~str > {
268
260
fn match_str ( s : & str , pos : uint , needle : & str ) -> bool {
269
261
let mut i = pos;
270
262
for ch in needle. byte_iter ( ) {
@@ -733,7 +725,8 @@ fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
733
725
}
734
726
}
735
727
736
- fn do_strftime( format : & str , tm : & Tm ) -> ~str {
728
+ /// Formats the time according to the format string.
729
+ pub fn strftime( format : & str , tm : & Tm ) -> ~str {
737
730
fn days_in_year ( year : int ) -> i32 {
738
731
if ( ( year % 4 == 0 ) && ( ( year % 100 != 0 ) || ( year % 400 == 0 ) ) ) {
739
732
366 /* Days in a leap year */
0 commit comments