convert.h File Reference

#include "cgeneral.h"
#include "cdate.h"

Functions

char * JpmcdsFormatDate (TDate date)
 Formats a TDate for printing.
char * JpmcdsFormatDateInterval (TDateInterval *interval)
 Formats a TDateInterval.
int JpmcdsStringToDate (char *mmddyyyy, TDate *tdate)
 Converts a date in string format to a TDate.
int JpmcdsStringToDateInterval (char *input, char *label, TDateInterval *interval)
 Converts a string representation ("2Y", "1S", etc) to a TDateInterval.
int JpmcdsMakeDateInterval (int numPeriods, char periodType, TDateInterval *interval)
 Makes a TDateInterval.

Detailed Description


Function Documentation

char* JpmcdsFormatDate ( TDate  date  ) 

Formats a TDate for printing.

The print format is YYYYMMDD. Can be called eight times from the same print statement, but not more.

char* JpmcdsFormatDateInterval ( TDateInterval interval  ) 

Formats a TDateInterval.

Can be called twice from the same print statement, but not more.

int JpmcdsMakeDateInterval ( int  numPeriods,
char  periodType,
TDateInterval interval 
)

Makes a TDateInterval.

Parameters:
numPeriods (I) Number of periods (Can be negative)
periodType (I) Period type (D,W,M,S,Q,A,I,J,K,E)
interval (O)

int JpmcdsStringToDate ( char *  mmddyyyy,
TDate tdate 
)

Converts a date in string format to a TDate.

The following formats are accepted: "YYYYMMDD", "MM/DD/YYYY", "Mth-DD-YYYY", and "DD-Mth-YYYY".

Parameters:
mmddyyyy (I) Month/Day/Year format
tdate (O) TDate

int JpmcdsStringToDateInterval ( char *  input,
char *  label,
TDateInterval interval 
)

Converts a string representation ("2Y", "1S", etc) to a TDateInterval.

Number optional, default is 1, hence, e.g., "M" (= "1M") is valid.

Parameters:
input (I) String w/ 1A, 3M, 4D, etc
label (I) Label-for JpmcdsErr Msg only
interval (O) Value read from file


Distributed by BN Algorithms Ltd -- consulting in quantitative finance, mathematical algorithms and software implementations. CDS Home Page. For enquires contact webs@bnikolic.co.uk.
This documentation is derived from ISDA CDS Standard Model version 1.7. You can get a copy of the original ISDA code at www.bnikolic.co.uk. This is a derivative work under the terms of the ISDA CDS Standard Model Public License. BN Algorithms Ltd licenses this work to you solely for on-screen viewing on your own computer. Making copies and further distribution of this work is prohibited.
This documentation is provided "as-is", without warranty of any kind, either expressed or implied, including, without limitation, warranties that the documentation is free of defects, merchantable, fit for a particular purpose or non-infringing. the entire risk as to the quality of the documentation is with you. Should this documentation prove defective in any respect, you (not the licensor) assume the cost of any necessary correction. This disclaimer of warranty constitutes an essential part of this license.