* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-use fmt::fmt_u32_pad;
+use fmt::{fmt_u32, fmt_u32_pad};
pub struct Time {
seconds: i32,
}
}
+ pub fn fmt_date(&self, s: &mut [u8]) {
+ let mut offset = 0;
+
+ offset += fmt_u32(&mut s[offset..], self.year as u32 + 1900);
+ s[offset] = b'-';
+ offset += 1;
+
+ offset += fmt_u32_pad(&mut s[offset..], self.month as u32 + 1, 2, b'0');
+ s[offset] = b'-';
+ offset += 1;
+
+ fmt_u32_pad(&mut s[offset..], self.day as u32, 2, b'0');
+ }
+
pub fn fmt_time(&self, s: &mut [u8]) {
let mut offset = 0;