|
Revision 1, 1.0 kB
(checked in by DenisG, 3 years ago)
|
Initial import
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
// |
|---|
| 2 |
// Softec |
|---|
| 3 |
// |
|---|
| 4 |
// Contact: |
|---|
| 5 |
// |
|---|
| 6 |
// Designed by Denis Gervalle and Olivier Desaive |
|---|
| 7 |
// Written by Denis Gervalle |
|---|
| 8 |
// |
|---|
| 9 |
// Copyright 2004 by SOFTEC. All rights reserved. |
|---|
| 10 |
// |
|---|
| 11 |
using System; |
|---|
| 12 |
using System.Text; |
|---|
| 13 |
using System.Runtime.InteropServices; |
|---|
| 14 |
using System.Diagnostics; |
|---|
| 15 |
|
|---|
| 16 |
namespace Softec.AprSharp |
|---|
| 17 |
{ |
|---|
| 18 |
public class AprTime |
|---|
| 19 |
{ |
|---|
| 20 |
private AprTime() |
|---|
| 21 |
{ |
|---|
| 22 |
} |
|---|
| 23 |
|
|---|
| 24 |
public static long Now() |
|---|
| 25 |
{ |
|---|
| 26 |
return(Apr.apr_time_now()); |
|---|
| 27 |
} |
|---|
| 28 |
|
|---|
| 29 |
public static string Rfc822Date(long value) |
|---|
| 30 |
{ |
|---|
| 31 |
StringBuilder buf = new StringBuilder(32); |
|---|
| 32 |
int res = Apr.apr_rfc822_date(buf,value); |
|---|
| 33 |
if (res != 0) |
|---|
| 34 |
throw new AprException(res); |
|---|
| 35 |
return(buf.ToString()); |
|---|
| 36 |
} |
|---|
| 37 |
|
|---|
| 38 |
public static string CTime(long value) |
|---|
| 39 |
{ |
|---|
| 40 |
StringBuilder buf = new StringBuilder(32); |
|---|
| 41 |
int res = Apr.apr_ctime(buf,value); |
|---|
| 42 |
if (res != 0) |
|---|
| 43 |
throw new AprException(res); |
|---|
| 44 |
return(buf.ToString()); |
|---|
| 45 |
} |
|---|
| 46 |
} |
|---|
| 47 |
} |
|---|