Struct Field13C

Source
pub struct Field13C {
    pub time: String,
    pub utc_offset1: String,
    pub utc_offset2: String,
}
Expand description

§Field 13C: Time Indication

§Overview

Field 13C specifies time indication(s) related to the processing of payment instructions in SWIFT MT messages. This field is used to indicate specific timing requirements or constraints for transaction processing, particularly in time-sensitive payment scenarios.

§Format Specification

Format: /8c/4!n1!x4!n

  • 8c: Time portion (8 characters: HHMMSS + 2 additional characters)
  • 4!n1!x4!n: UTC offset (4 digits + sign + 4 digits, format: ±HHMM)
  • 4!n1!x4!n: Second UTC offset (4 digits + sign + 4 digits, format: ±HHMM)

§Structure

/HHMMSS+D/±HHMM/±HHMM
│└─────┘│ │    │ │
│  Time │ │    │ └── Second UTC offset
│       │ │    └──── First UTC offset  
│       │ └───────── Time remainder/indicator
│       └─────────── Time (HHMMSS)
└─────────────────── Field delimiter

§Time Codes and Indicators

The time portion consists of:

  • HH: Hours (00-23)
  • MM: Minutes (00-59)
  • SS: Seconds (00-59)
  • +D: Additional indicator (varies by usage context)

Common time indicators include:

  • +0, +1, +2, etc.: Numeric indicators
  • +D: Day indicator
  • +X: Special processing indicator

§UTC Offset Format

UTC offsets must follow the format ±HHMM:

  • ±: Plus (+) or minus (-) sign
  • HH: Hours offset from UTC (00-14)
  • MM: Minutes offset (00-59, typically 00 or 30)

§Usage Context

Field 13C is commonly used in:

  • MT103: Single Customer Credit Transfer
  • MT202: General Financial Institution Transfer
  • MT202COV: Cover for customer credit transfer

§Business Applications

  • Cut-off times: Specify latest processing time
  • Value dating: Indicate when funds should be available
  • Time zone coordination: Handle cross-border payments
  • STP processing: Ensure straight-through processing timing

§Examples

:13C:/CLSTIME/153045+1/+0100/-0500
└─── CLS Bank cut-off time at 15:30:45+1, CET (+0100), EST (-0500)

:13C:/RNCTIME/090000+0/+0000/+0900  
└─── TARGET receive time at 09:00:00, UTC (+0000), JST (+0900)

:13C:/SNDTIME/235959+D/+0200/-0800
└─── Send time at 23:59:59+D, CEST (+0200), PST (-0800)

§Validation Rules

  1. Time format: Must be exactly 8 characters (HHMMSS + 2 chars)
  2. Time values: Hours (00-23), Minutes (00-59), Seconds (00-59)
  3. UTC offsets: Must be ±HHMM format with valid ranges
  4. Structure: Must have exactly 3 parts separated by ‘/’
  5. Leading slash: Field content must start with ‘/’

§Network Validated Rules (SWIFT Standards)

  • Time indication must be a valid time expressed as HHMM (Error: T38)
  • Sign must be either “+” or “-” (Error: T15)
  • Time offset hours must be 00-13, minutes 00-59 (Error: T16)
  • Format must comply with SWIFT field specifications

Fields§

§time: String

Time portion (8 characters: HHMMSS + 2 additional characters)

Format: HHMMSS+D where:

  • HH: Hours (00-23)
  • MM: Minutes (00-59)
  • SS: Seconds (00-59)
  • +D: Additional indicator (context-dependent)

Examples: “153045+1”, “090000+0”, “235959+D”

§utc_offset1: String

First UTC offset (format: ±HHMM)

Represents the UTC offset for the first timezone reference. Format: ±HHMM where:

  • ±: Plus (+) or minus (-) sign
  • HH: Hours offset from UTC (00-14)
  • MM: Minutes offset (00-59, typically 00 or 30)

Examples: “+0100” (CET), “-0500” (EST), “+0000” (UTC)

§utc_offset2: String

Second UTC offset (format: ±HHMM)

Represents the UTC offset for the second timezone reference. Used for cross-timezone coordination or dual time indication. Same format as utc_offset1.

Examples: “-0800” (PST), “+0900” (JST), “+0530” (IST)

Implementations§

Source§

impl Field13C

Source

pub fn new( time: impl Into<String>, utc_offset1: impl Into<String>, utc_offset2: impl Into<String>, ) -> Result<Self>

Create a new Field13C with comprehensive validation

§Arguments
  • time - Time portion (8 characters: HHMMSS + 2 additional chars)
  • utc_offset1 - First UTC offset (±HHMM format)
  • utc_offset2 - Second UTC offset (±HHMM format)
§Examples
use swift_mt_message::fields::Field13C;

// CLS Bank cut-off time
let field = Field13C::new("153045+1", "+0100", "-0500").unwrap();

// TARGET processing time
let field = Field13C::new("090000+0", "+0000", "+0900").unwrap();
§Errors

Returns ParseError if:

  • Time is not exactly 8 characters
  • Hours, minutes, or seconds are out of valid range
  • UTC offsets are not in ±HHMM format
  • UTC offset values are out of valid range
Source

pub fn time(&self) -> &str

Get the complete time portion

Returns the full 8-character time string including the time indicator.

§Returns

The time string in format HHMMSS+D

§Example
let field = Field13C::new("153045+1", "+0100", "-0500").unwrap();
assert_eq!(field.time(), "153045+1");
Source

pub fn utc_offset1(&self) -> &str

Get the first UTC offset

Returns the first UTC offset in ±HHMM format.

§Returns

The first UTC offset string

§Example
let field = Field13C::new("153045+1", "+0100", "-0500").unwrap();
assert_eq!(field.utc_offset1(), "+0100");
Source

pub fn utc_offset2(&self) -> &str

Get the second UTC offset

Returns the second UTC offset in ±HHMM format.

§Returns

The second UTC offset string

§Example
let field = Field13C::new("153045+1", "+0100", "-0500").unwrap();
assert_eq!(field.utc_offset2(), "-0500");
Source

pub fn hours(&self) -> u32

Extract hours from the time portion

Parses and returns the hours component (00-23) from the time string.

§Returns

Hours as u32, or 0 if parsing fails

§Example
let field = Field13C::new("153045+1", "+0100", "-0500").unwrap();
assert_eq!(field.hours(), 15);
Source

pub fn minutes(&self) -> u32

Extract minutes from the time portion

Parses and returns the minutes component (00-59) from the time string.

§Returns

Minutes as u32, or 0 if parsing fails

§Example
let field = Field13C::new("153045+1", "+0100", "-0500").unwrap();
assert_eq!(field.minutes(), 30);
Source

pub fn seconds(&self) -> u32

Extract seconds from the time portion

Parses and returns the seconds component (00-59) from the time string.

§Returns

Seconds as u32, or 0 if parsing fails

§Example
let field = Field13C::new("153045+1", "+0100", "-0500").unwrap();
assert_eq!(field.seconds(), 45);
Source

pub fn time_remainder(&self) -> &str

Get the time remainder/indicator

Returns the last 2 characters of the time string, which typically contain additional time indicators or processing codes.

§Returns

The time remainder string (2 characters)

§Example
let field = Field13C::new("153045+1", "+0100", "-0500").unwrap();
assert_eq!(field.time_remainder(), "+1");
Source

pub fn is_cls_time(&self) -> bool

Check if this is a CLS Bank time indication

Determines if this field represents a CLS Bank cut-off time based on common patterns and indicators.

§Returns

true if this appears to be a CLS time indication

Source

pub fn is_target_time(&self) -> bool

Check if this is a TARGET system time indication

Determines if this field represents a TARGET (Trans-European Automated Real-time Gross Settlement Express Transfer) system time indication.

§Returns

true if this appears to be a TARGET time indication

Source

pub fn description(&self) -> String

Get a human-readable description of the time indication

Returns a descriptive string explaining what this time indication represents based on common SWIFT usage patterns.

§Returns

A descriptive string

§Example
let field = Field13C::new("153045+1", "+0100", "-0500").unwrap();
println!("{}", field.description());

Trait Implementations§

Source§

impl Clone for Field13C

Source§

fn clone(&self) -> Field13C

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Field13C

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Field13C

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Field13C

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Field13C

Source§

fn eq(&self, other: &Field13C) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Field13C

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl SwiftField for Field13C

Source§

fn parse(value: &str) -> Result<Self, ParseError>

Parse field value from string representation
Source§

fn to_swift_string(&self) -> String

Convert field back to SWIFT string format
Source§

fn validate(&self) -> ValidationResult

Validate field according to SWIFT format rules
Source§

fn format_spec() -> &'static str

Get field format specification
Source§

impl StructuralPartialEq for Field13C

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,